Skip to content

Releases: princello/ncountr

v0.2.0 — Pathway-level analysis, hardened and packaged

Choose a tag to compare

@princello princello released this 07 Jul 18:49

ncountr 0.2.0

This release brings pathway-level analysis to ncountr and hardens the package with a comprehensive, multi-version test suite. It also corrects the package version: 0.1.0 was the last release on PyPI, but the code already self-identified as 0.2.0 — this release reconciles that.

nCounter studies usually have small sample sizes (n=3–12) where gene-level FDR correction returns nothing significant. The headline of 0.2.0 is a set of pathway-level methods built for exactly that regime. Those analysis features landed during development (commit 9c84e3d); the work since has been test hardening, bug fixes, and packaging correctness.

✨ New analysis features

  • Permutation-based GSEA (Subramanian et al.) with exact enumeration for small n (≤10 total samples), plus a pre-ranked variant — gsea, gsea_preranked.
  • Competitive gene-set test (CAMERA-like): Wilcoxon rank-sum on per-gene t-statistics, in-set vs out-of-set — competitive_test.
  • Self-contained permutation test on pathway-score differences — self_contained_test.
  • 12 built-in MSigDB Hallmark gene sets for immune/host-response panels, plus a GMT parser for custom sets — load_gmt / save_gmt.
  • Effect-size reporting: Cohen's d with bootstrap CIs and rank-biserial correlation — effect_sizes, de(effect_size=True).
  • ssGSEA single-sample pathway scoring.
  • New figures: GSEA enrichment plot, GSEA dot plot, and effect-size volcano.

✅ Reliability & testing

  • Test suite expanded from 150 → 291 tests, now covering every module (GSEA, pathway, effect sizes, gene sets, datasets, export/AnnData, GEO download, CLI, plotting, cross-platform). Coverage ~93%.
  • CI runs the full matrix on Python 3.9, 3.10, 3.11, 3.12 and installs the crossplatform extra, so the AnnData/scanpy code paths are actually exercised.

🐛 Bug fixes

  • GSEA empty result: competitive_test, self_contained_test, and gsea_preranked crashed with KeyError: 'pvalue' when no gene set passed the overlap filter — common on small panels. They now return a correctly-typed empty result.
  • matplotlib ≥3.11: the pathway box plot crashed because boxplot(labels=…) was removed. Now uses set_xticklabels, compatible with matplotlib ≥3.5.
  • Python 3.9 CLI: ncountr de failed with "No such command 'de'" under Click 8.1 (newest on 3.9), which doesn't strip the _cmd suffix. The command name is now pinned explicitly.

📦 Packaging

  • Version is single-sourced from pyproject.toml (read at runtime via importlib.metadata), resolving the 0.1.0/0.2.0 mismatch so built artifacts report the correct version. A test guards against future drift.

Full changelog: v0.1.0...v0.2.0

v0.1.0 — Initial release

Choose a tag to compare

@princello princello released this 24 Mar 14:16

ncountr v0.1.0

First public release of ncountr — the first Python package for end-to-end Nanostring nCounter gene expression analysis.

Features

  • RCC parsing — read .RCC files from one or more directories into a structured experiment object
  • Quality control — FOV ratio, positive control linearity, housekeeping stability, negative background
  • Normalization — positive control, housekeeping, and background subtraction methods
  • Differential expression — Mann-Whitney U or t-test with FDR correction
  • Gene set scoring — built-in IFN/JAK-STAT pathway (48 genes) + custom gene sets
  • Publication-ready plots — QC summary, volcano, heatmap, pathway score box plots
  • Cross-platform validation — correlation, DE concordance, and composition analysis vs RNA-seq
  • AnnData exportto_anndata() for scverse ecosystem integration
  • GEO downloaderncountr fetch-geo GSE275334 downloads RCC files directly
  • Config-driven pipeline — single YAML file runs the entire analysis

Validated on 5 published datasets (1,458 samples)

Dataset Panel Samples Key result
GSE275334 Immune Exhaustion 47 Long COVID / ME/CFS 3-group design
GSE140901 PanCancer Immune 24 ICI responder vs non-responder
GSE117751 Human Immunology 42 2 FDR-significant genes (AIR vs Control)
GSE268012 Human Metabolism 24 232 DE genes for IFNβ vs Control
GSE74821 PAM50 Custom 1,321 Parsed in 3s, 99.5% QC pass rate

Install

pip install ncountr