Add ncountr - #348
Conversation
|
Thanks for the submission! I reviewed the code against our checklist and it's in great shape We would like to flag, though, that the PR uses a shortened checklist, and it's missing the mandatory item
Could you paste the full checklist from the repo README and tick all mandatory items including this? That author-consent confirmation is required for us to list the package Two more minor, non-blocking notes: the "automated tests" checklist item is also missing, though your tests clearly cover it; and the version field reads "v0.1.0" while PyPI lists it as "0.1.0". You may want to drop the "v"? Other feedback (not related to the checklist): currently AnnData only comes in at the end via to_anndata(), while the analysis runs on the NanostringExperiment object. That's completely fine but it would just be nice if a tutorial showed how to take the exported AnnData onward into a scanpy workflow, so users can see how ncountr plugs into the broader scverse ecosystem! Thanks again! |
|
Thanks for the careful review, @muskanhashim — apologies for the shortened checklist. Here is the full one from the README with all mandatory items answered. Also fixed in One correction to my own PR description above: I wrote Checklist for adding packagesMandatoryName of the tool: ncountr Short description: A Python package for end-to-end NanoString nCounter gene expression analysis — RCC file parsing, quality control, normalization (positive-control, CodeSet content, and housekeeping), differential expression testing (per-gene Mann-Whitney U or t-test with FDR correction), gene set scoring, and GSEA. How does the package use scverse data structures: ncountr parses raw RCC files into a
Recommended
On the scanpy tutorial suggestion — that is a fair point, and you were right that it stopped at the export. This has since been implemented; see the follow-up comment below. Thanks again for the review. (Edited: corrected the differential-expression description — |
* Add scanpy downstream section to GSE275334 vignette; fix broken plotting calls Adds a section 9 to the Long COVID vignette carrying the exported AnnData into a real scanpy workflow (PCA, QC-coloured components, group dendrogram, rank_genes_groups, matrixplot), including a cross-check that re-running the Long COVID vs Healthy contrast through scanpy reproduces the ncountr.de() ranking (Spearman rho 0.999998, 19/20 top genes shared). Addresses reviewer feedback on scverse/ecosystem-packages#348. Also fixes API misuse that made four of the five vignettes fail on execution: - plot_pathway_scores() was called with a DataFrame plus score_column=/ group_column=, which it has never accepted. It takes a pd.Series of scores and a {group_name: [sample_ids]} dict. - plot_heatmap() was called with the experiment plus genes=/samples=/z_score=. It takes a genes x samples DataFrame and the keyword is zscore. All five vignettes now execute end to end under nbconvert. * Harden vignette validation, expose tutorials in docs, sync ecosystem metadata Follows up the scanpy section with the regression protection and documentation work needed to make the five advertised tutorials trustworthy. Scanpy section revisions: - the canonical exported `adata` is no longer mutated; the scanpy walkthrough operates on an explicit `adata_sc` copy - adds a cell showing the sample/QC/lane annotations carried across by the export - states that no library-size renormalization is applied, since .X already holds positive-control + housekeeping normalized counts - the UMAP/Leiden omission is now justified purely methodologically (46 bulk profiles on a targeted panel), with no claim about behaviour not exercised here Regression prevention: - tests/test_vignette_api.py statically checks every ncountr call in every vignette against the live signature, plus notebook hygiene (no committed outputs, execution counts or tracebacks). Runs in the existing fast CI. Verified against the pre-fix notebooks: it reports all five real mismatches. - .github/workflows/vignettes.yml executes all five notebooks weekly and on demand on Python 3.11, one matrix job each, into a temp dir so sources are never modified. Documentation: - docs/vignettes/index.rst now lists all five tutorials with dataset, context, sample count, panel and links; previously an empty toctree, which is what the scverse tutorials_home URL points at - api.rst/conf.py: drop the duplicate NanostringExperiment registration and render docstring Attributes as :ivar:. Sphinx -W warnings 28 -> 1 (the remainder is a third-party sphinx_autodoc_typehints deprecation) Ecosystem metadata: - scverse-submission/meta.yaml version v0.1.0 -> 0.2.0, matching the released package and the submitted PR - conda-recipe/meta.yaml to 0.2.0 with the verified sdist sha256, drops the unused setuptools-scm host dep, adopts python_min, adds pip check No changes under src/; package version stays 0.2.0. * Migrate conda recipe to the CEP 13 v1 recipe.yaml format conda-forge/staged-recipes now expects recipe.yaml: every recipe merged there recently uses it, and the conda-build meta.yaml example is checked in as 'example-v0-deprecated'. Converts the mirrored recipe so it matches what is actually submitted, and documents how to refresh version + sha256 together.
|
Great, @princello! Everything from the checklist side is resolved, thanks for the thorough follow-up and the Scanpy vignette! In our attempt for users to be able to discover scverse ecosystem packages more easily, there is unfortunately a small new requirement on our side: The registry schema was just tightened (#392) after your PR was opened, so the metadata validation (mkjson + pre-commit) now fails. Two quick fixes needed in packages/ncountr/meta.yaml to match the new schema:
Please feel free to pick whichever tags/primary_category best fit from the allowed lists in the schema. Once that's in and the checks go green, this is good to merge. Thanks again for bearing with the moving target! |
Add ncountr to the scverse ecosystem
ncountr is a Python package for end-to-end NanoString nCounter gene expression analysis. It provides RCC file parsing, quality control, normalization (positive-control, CodeSet content, and housekeeping), differential expression testing (per-gene Mann-Whitney U or t-test with FDR correction), gene set scoring, and GSEA.
AnnData integration
nCounter is a bulk, targeted-panel platform, so the parsing, platform-specific QC and normalization stages operate on ncountr's own
NanostringExperimentcontainer. AnnData is the interoperability layer: the module-level functionncountr.to_anndata(exp)exports the analysed experiment — normalized counts in.X, raw counts in.layers["raw"], sample metadata plus QC metrics and lane/cartridge information in.obs, and gene annotations including housekeeping flags in.var— so the result can be handed to scanpy and the rest of the scverse ecosystem without losing its sample or gene metadata.The GSE275334 Long COVID vignette demonstrates that handoff end to end: PCA, principal components coloured by the QC and lane variables carried across in
.obs, a group dendrogram,rank_genes_groups, and a matrixplot — plus a cross-check that re-running the same contrast in scanpy reproduces thencountr.de()gene ranking (Spearman ρ = 0.999998, 19 of the top 20 genes shared).Checklist
ncountr.to_anndata(exp)exportThe full checklist from the repository README is filled in in this comment.