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

pirl-unc / tcrsift / 25601586729

09 May 2026 12:51PM UTC coverage: 71.44% (+0.02%) from 71.421%
25601586729

push

github

web-flow
Add per-(donor, method) ranked CSV outputs (#20 chunk 2) (#24)

Second slice of #20. Builds on the long-format table from chunk 1
(v0.7.3): for each populated (donor, method) bucket, emit a ranked
CSV of the filter-passing clones in that bucket, ordered by their
within-(donor, method) frequency descending.

clonotype.build_per_method_rankings(filtered, long_df, top_n) ->
  dict[(donor, method), DataFrame]

  Aggregates long_df to one row per (donor, method, CDR3ab) (max freq
  across any sample replicates within the bucket; sum cells), inner-
  joins against `filtered` to keep only clones that survived
  filtering, then takes top_n per bucket.

  Each row carries:
    - tier             when filter_mode='fdr' produced filtered
    - max_frequency / cell_count / n_donors / n_methods   if present
    - sharing          derived "private" / "public" from n_donors
                       so outputs are mode-agnostic and self-describing

  Returns {} when method axis isn't on long_df. When donor isn't on
  long_df but method is, folds under a synthetic donor='all' so file
  naming stays uniform.

cmd_run wiring:

  - Step 3 now keeps long_df in memory whenever it'll be consumed
    (chunk-1 CSV emission OR enrichment_method axis present so
    chunk-2 can use it). Disk emission of clone_sample_long.csv stays
    gated by --emit-clone-sample-long.
  - Step 4 adds an emit block after the bucket files: writes one CSV
    per (donor, method) into data/filtered_by_method/<donor>__<method>.csv,
    with filename sanitization for path-unfriendly chars.

CLI / config:
  - --per-method-top-n N    default 100, on `tcrsift run`
  - OutputConfig.per_method_top_n   threaded through YAML config

Tests cover:
  - one ranked table per (donor, method) bucket; expected key set
  - tier and sharing annotation present and correct (public for
    n_donors>=2, private for n_donors==1)
  - donor / method dropped from row schema (encoded in dict key)
  - only filter-passing clones ... (continued)

4355 of 6096 relevant lines covered (71.44%)

2.86 hits per line

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

55.81
/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