-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AnnData
Conversion Notebook
#1079
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful stuff overall. I think once the lab gets familiar with AnnData
/dask
/zarr
they'll find it very easy to use. Mostly structural comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notebook looks much cleaner!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, sorry for the late review
@@ -0,0 +1,207 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the embedded image show up correctly in the actual notebook? Not showing up here, could just be an issue with reviewnb
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome, just a couple small comments
te the Co-authored-by: Noah F. Greenwald <noahfgreenwald@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
If you haven't already, please read through our contributing guidelines before opening your PR
What is the purpose of this PR?
Main Features
Adds a notebook for converting the cell table to per-FOV
AnnData
objects. By default, they get saved todata/<my-cohort>/anndata
in the notebook. In addition, it briefly covers viewing components of theAnnData
object, and creating data pipelines with a small application for constructing spatial neighbors withsquidpy
.AnnData
object with:centroid-0
centroid_y
,centroid-1
centroid_x
), stored inobsm["spatial"]
.var_names
/X
.obs
.settings.CELL_SIZE
in favor of the generic"area"
as a column name inobs
, as we can have tables for many kinds of segmentations / observations (cell, fiber, ez_seg, etc...)AnnCollection
.datapipe
to iterate over theAnnCollection
FOV by FOV.Documentation
AnnData
section fordata_types.md
with figures.AnnData
section fordevelopment.md
.Testing
test_utils.make_cell_table
to have the expected ordering for Cell Tables. Addedn_cells
andn_markers
to create different sized cell tables.AnnData
tables with various values ofn_obs
, and floating point and categorical column types. (test_utils.generate_anndata_table
andtest_utils.generate_anncollection
)How did you implement your changes
Dask
to work with converting large cell tables.TorchData
to create theAnnData
IterDataPipe
. This allows us to implement more intricate data pipelines with shuffling, mapping, and filtering functionality, and construct data loaders withDataLoader2
test_utils.make_cell_table
.Remaining Issues
AnnData
objects. We can try some stuff, and see what works best.