chanzuckerberg / cellxgene-census

CZ CELLxGENE Discover Census
https://chanzuckerberg.github.io/cellxgene-census/
MIT License
72 stars 18 forks source link

[python] CensusSCVIDataModule + notebook #1196

Open ebezzi opened 2 weeks ago

ebezzi commented 2 weeks ago

This PR contains:

  1. An implementation of CensusSCVIDataModel that allows to train an scVI model using the Pytorch data loaders
  2. A notebook that explains how to do the training end to end. Preview here

Note for reviewers: marking as draft as there are some items missing:

  1. Still depends on https://github.com/chanzuckerberg/cellxgene-census/pull/1191, which in turns require some testing/changes. Currently WIP
  2. CensusSCVIDataModule needs to be refactored to comply with our linter
pablo-gar commented 4 days ago

@ebezzi Should we add torchdata as a dependency of the experimental package? it's required by CensusSCVIDataModule

pablo-gar commented 4 days ago

@ebezzi can you please add two cells at the end:

sc.pl.umap(adata, color="tissue_general", title="SCVI")

and

sc.pl.umap(adata, color="cell_type", title="SCVI")
ebezzi commented 3 days ago

@ebezzi Should we add torchdata as a dependency of the experimental package? it's required by CensusSCVIDataModule

It's already in the requirements (see pyproject.toml)

codecov[bot] commented 3 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.16%. Comparing base (085ec6e) to head (6edd123). Report is 4 commits behind head on ebezzi/support-custom-obs-encoders.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## ebezzi/support-custom-obs-encoders #1196 +/- ## ====================================================================== + Coverage 91.10% 91.16% +0.05% ====================================================================== Files 77 77 Lines 5982 6022 +40 ====================================================================== + Hits 5450 5490 +40 Misses 532 532 ``` | [Flag](https://app.codecov.io/gh/chanzuckerberg/cellxgene-census/pull/1196/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=chanzuckerberg) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/chanzuckerberg/cellxgene-census/pull/1196/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=chanzuckerberg) | `91.16% <100.00%> (+0.05%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=chanzuckerberg#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.