Skip to content

Copy number Harmonization - all datasets. - #507

Merged
sgosline merged 4 commits into
mainfrom
copy-number-harmonization
Oct 6, 2026
Merged

sgosline merged 4 commits into
mainfrom
copy-number-harmonization

Conversation

@jjacobson95

Copy link
Copy Markdown
Collaborator

Pipeline Hardening/Debugging PR # 17

Note: Merge this PR only after all other 2.4 build PRs. Once those PRs are merged, update this branch from main and merge. Basically just review and then tell me to merge.


Harmonize copy number across datasets

Convert copy-number values to the DepMap log2(relative CN + 1) scale before assigning copy calls.

  • Convert log2-ratio inputs for Sanger, MPNST, CPTAC, pancreatic, liver, bladder, and colorectal.
  • Convert Novartis absolute copy counts relative to diploid copy number.
  • Convert HCMI ASCAT copy counts relative to sample tumor ploidy, using 2 when ploidy is unavailable.
  • Apply the same copy-call thresholds to the harmonized values.
  • Allow values above 2 when recomputing copy calls in the Python package.

Additional update:
Also read the HCMI MAF PUBMED column as text. Some rows contain multiple semicolon-separated PubMed IDs; treating the column as numeric caused otherwise valid mutation files to be skipped.

Closes #506.

Each builder converted raw copy number differently, so copy_number was
stored on different scales while copy_call applied one set of cutoffs
(0.521 / 0.731 / 1.214 / 1.422, on DepMap's log2(relative CN + 1) scale)
to all of them. Convert every source to that scale so the stored values
are comparable and the calls are correct (0/1/2/3/4 copies ->
deep del / het loss / diploid / gain / amp).

- Sanger (gdscv1/v2), mpnst, cptac, pancreatic, liver: log2 ratio s ->
  log2(2^s + 1)
- bladder, colorectal: segment log2 ratio -> log2(2^s + 1) (was
  2*2^(s/2))
- novartis: absolute copies -> log2(c/2 + 1)
- hcmi: absolute ASCAT copies -> log2(c/ploidy + 1), using per-sample
  tumor_ploidy from the GDC ASCAT segment files (2 if unavailable)
- pancreatic: replace its own cutoffs with the shared ones
- cptac: fix the 1.42233 gain cutoff typo
- coderdata: copy_call bins use -inf/inf so values outside [0, 2] are
  labelled instead of becoming NaN
@jjacobson95 jjacobson95 added this to the 2.4 new build milestone Oct 5, 2026
@jjacobson95
jjacobson95 requested a review from sgosline October 5, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy Calls Were Incorrectly Harmonized

2 participants