-
Notifications
You must be signed in to change notification settings - Fork 118
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
feat: add cli annotation subcommand #2539
feat: add cli annotation subcommand #2539
Conversation
…pko/2518-cell-type-prediction-cli-cmd
- "model" is actually two models now, one for ref mapping (scvi pytorch) and one for classifier (XGBoost) - remove all gene column congruency logic, as that is handled by scvi - tests currently broken
…pko/2518-cell-type-prediction-cli-cmd
Codecov Report
@@ Coverage Diff @@
## main #2539 +/- ##
==========================================
+ Coverage 71.53% 71.60% +0.06%
==========================================
Files 94 96 +2
Lines 6503 6652 +149
Branches 770 770
==========================================
+ Hits 4652 4763 +111
- Misses 1775 1813 +38
Partials 76 76
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. |
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.
The general framework looks good - I had a couple questions about the input and output (see comments). I'll take a look at this again after reading through the tech spec.
@click.option( | ||
"-l", | ||
"--counts-layer", | ||
help="If specified, raw counts will be read from the AnnData layer of the specified name. If unspecified, " |
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.
Let's say users have raw counts in raw.X
and processed counts in X
, and users wish to specify the processed counts. Is X
available as an entry in adata.layers
?
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.
adata.X
will be used per this logic
|
||
p.wait() | ||
if p.returncode == 0: | ||
print(f"Wrote annotations to {cli_args.get('output_h5ad_file')}") |
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.
Where is the h5ad file actually getting written? Does mlflow models predict
support h5ad
files natively?
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.
The model itself is writing out the h5ad file, so the output is ignored. For those curious the h5ad writing is done here.
reverted code to previous implementation that was presumably changed due to destructuring assignment lint error; explicitly ignoring error
test/unit/common/test_api.py
Outdated
@@ -290,6 +290,7 @@ def test_colors(self): | |||
result_data = result.json() | |||
self.assertEqual(result_data, pbmc3k_colors) | |||
|
|||
@unittest.skip('needs fix') # TODO |
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.
.github/workflows/push_tests.yml
Outdated
@@ -104,7 +106,7 @@ jobs: | |||
|
|||
smoke-tests-annotations: | |||
runs-on: ubuntu-latest | |||
timeout-minutes: 20 | |||
timeout-minutes: 30 |
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.
TODO: revert
…18-cell-type-prediction-cli-cmd
…pko/2518-cell-type-prediction-cli-cmd
https://app.zenhub.com/workspaces/single-cell-5e2a191dad828d52cc78b028/issues/chanzuckerberg/cellxgene/2518
Reviewers
Functional:
@MaximilianLombardo @seve @atarashansky @MDunitz
Readability:
Changes
Adds
cellxgene annotate
subcommand. This invokes an arbitrary MLflow model that accepts an H5AD file as input and outputs an H5AD (or updates existing H5AD) with annotations added. The initial use case is for a cell type annotation ML model.I've commented out test_api test_static unit test(s), as this is the only failing backend test. It is just the favicon request that is failing, and we can fix that as another issue/PR.
QA