• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pirl-unc / tcrsift / 25590034963

09 May 2026 03:08AM UTC coverage: 71.421% (+0.1%) from 71.284%
25590034963

push

github

web-flow
Add long-format clone-by-sample CSV output (#20 chunk 1) (#23)

First slice of #20. Surfaces the per-(clone, sample) view that users
were previously reconstructing by parsing the semicolon-delimited
`samples` string on `clonotypes.csv`.

clonotype.build_clone_sample_long(adata) -> pd.DataFrame

  One row per (CDR3ab, sample) pair where the clone has >=1 cell:
    CDR3ab, sample, donor?, method?, timepoint?, apc?,
    cells, frequency, n_alpha_umis?, n_beta_umis?

  Axis columns (donor / method / timepoint / apc) are emitted only
  when the corresponding obs columns are populated, mapped to the
  short names used in the issue's column spec.

  Frequency denominator: total complete-clone cells in the sample,
  matching the convention used by max_frequency in
  aggregate_clonotypes so the two values are directly comparable.

  UMI columns (n_alpha_umis / n_beta_umis) are sums of TRA_1_umis /
  TRB_1_umis across cells in the (clone, sample) group, when those
  per-chain UMI columns are present in obs.

  Self-contained: builds CDR3ab on the fly if it isn't already on
  obs (aggregate_clonotypes works on a copy and doesn't write CDR3ab
  back). Calls rehydrate_obs first so post-h5ad-roundtrip dtypes
  don't break the groupby.

cmd_run wires it into Step 3 with a CLI knob:

  --emit-clone-sample-long {auto,always,never}    default 'auto'

  'auto' = emit when the run has >=2 samples (the regime where the
  long view is most useful and reconstructing it is most annoying).
  Threaded through OutputConfig so YAML configs work too.

Tests cover:
  - cell counts match input
  - donor / method propagation per-sample
  - UMI sums correct
  - frequency denominator uses complete-clone cells when available
  - axis columns omitted when fields aren't on obs
  - empty CDR3 cells skipped
  - raises sensibly when CDR3 columns missing entirely

Bumps version to 0.7.3 — additive output, no breaking change.

Subsequent chunks: per-method ranked CSVs, method x method overlap... (continued)

4326 of 6057 relevant lines covered (71.42%)

2.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

56.21
/cli.py


Source Not Available

The file "cli.py" isn't available on github. Either it's been removed, or the repo root directory needs to be updated.

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc