[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ECE28XVXP3YNKSW9GNQH4Y":3,"skill-same:01M7ECE28XVXP3YNKSW9GNQH4Y":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7ECE28XVXP3YNKSW9GNQH4Y","bio-copy-number-gatk-cnv",null,"Call copy number variants with the GATK best-practices workflows — the somatic CNV pipeline (CollectReadCounts, DenoiseReadCounts with tangent normalization, ModelSegments, CallCopyRatioSegments) and the germline GATK-gCNV pipeline (DetermineGermlineContigPloidy, GermlineCNVCaller cohort\u002Fcase mode, PostprocessGermlineCNVCalls). Covers panel-of-normals construction, AnnotateIntervals\u002FFilterIntervals, allelic-count integration, and QS-based filtering. Use when integrating CNV calling into a GATK variant pipeline, calling rare germline CNVs from an exome cohort, deciding between the somatic and germline GATK workflows, or diagnosing why tangent normalization removed a real event or why gCNV output has low precision.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-copy-number-gatk-cnv\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-copy-number-gatk-cnv\ndescription: Call copy number variants with the GATK best-practices workflows — the somatic CNV pipeline (CollectReadCounts, DenoiseReadCounts with tangent normalization, ModelSegments, CallCopyRatioSegments) and the germline GATK-gCNV pipeline (DetermineGermlineContigPloidy, GermlineCNVCaller cohort\u002Fcase mode, PostprocessGermlineCNVCalls). Covers panel-of-normals construction, AnnotateIntervals\u002FFilterIntervals, allelic-count integration, and QS-based filtering. Use when integrating CNV calling into a GATK variant pipeline, calling rare germline CNVs from an exome cohort, deciding between the somatic and germline GATK workflows, or diagnosing why tangent normalization removed a real event or why gCNV output has low precision.\ntool_type: cli\nprimary_tool: gatk\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"copy-number\u002Fgatk-cnv\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: GATK 4.5+ (gatk4), Python 3.10+ (gcnv conda env), R 4.3+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `gatk --version` then `gatk \u003CToolName> --help` to confirm arguments\n- gCNV requires a working `gatkcondaenv` (theano\u002Ftensorflow stack) — `gatk` will report if the Python environment is missing\n\nGATK 4.5+ gCNV inference defaults are tuned for whole-exome data; whole-genome runs generally need parameter changes. If a tool reports an unrecognized argument, check the help for that exact GATK version rather than retrying.\n\n# GATK CNV Workflows\n\n**\"Call CNVs the GATK way\"** -> GATK has two *separate* CNV workflows that share almost no tools. Picking the wrong one is the most common mistake.\n\n- Somatic CNV: `CollectReadCounts` -> `DenoiseReadCounts` -> `ModelSegments` -> `CallCopyRatioSegments`. Tumor copy-ratio segments, optionally allele-aware.\n- Germline gCNV: `DetermineGermlineContigPloidy` -> `GermlineCNVCaller` -> `PostprocessGermlineCNVCalls`. Per-sample germline CN genotypes (VCF).\n\n## Critical: What GATK Somatic CNV Does NOT Provide\n\n`ModelSegments` + `CallCopyRatioSegments` produce **copy-ratio segments** and a **minor-allele fraction** per segment, and the \"call\" is a simple t-test emitting `+` \u002F `-` \u002F `0`. This is **not** integer allele-specific copy number, **not** tumor purity, and **not** ploidy. Practitioners routinely assume parity with ASCAT\u002FFACETS and there is none. For integer allele-specific CN, purity, ploidy, LOH state, or whole-genome-doubling status, use allele-specific-copy-number (ASCAT, Sequenza, FACETS, or PureCN — PureCN can even reuse the GATK `ModelSegments` segmentation as input).\n\n## Somatic vs Germline — Choosing the Workflow\n\n| Question | Somatic CNV | Germline gCNV |\n|----------|-------------|---------------|\n| Input | One tumor (+ optional matched normal) | A cohort of constitutional samples |\n| Output | Copy-ratio segments, +\u002F-\u002F0 call, minor-allele fraction | Integer germline CN genotype VCF per sample |\n| Normalization | Tangent (projection onto PoN subspace) | PCA batching + Bayesian read-depth model |\n| Cohort needed | PoN of normals for denoising | >= ~100 technically matched samples (cohort mode) |\n| Use for | Tumor SCNAs, focal amplifications\u002Fdeletions | Rare\u002Fde novo germline CNVs, NDD\u002FMendelian cohorts |\n\n## Decision Tree by Scenario\n\n| Scenario | Workflow | Key parameters |\n|----------|----------|----------------|\n| Tumor-normal WGS\u002FWES, want SCNAs | Somatic, with matched-normal allelic counts | `PreprocessIntervals --bin-length 1000` (WGS) or `0` (WES) |\n| Tumor-only somatic CNV | Somatic, no matched-normal allelic counts | Genotype hets in the case sample; expect more no-calls |\n| Rare germline CNV, exome cohort >= 100 | gCNV cohort mode | Run `DetermineGermlineContigPloidy` cohort first |\n| New sample vs an existing gCNV model | gCNV case mode | Must reuse identical scatter count and interval list |\n| Need integer ASCN \u002F purity \u002F ploidy | Neither — escalate | Use allele-specific-copy-number |\n| Targeted panel (\u003C few hundred genes) | Prefer CNVkit | GATK interval models are unstable on tiny panels |\n\n## Somatic CNV Pipeline\n\n```bash\n# 1. Preprocess and annotate intervals (WES: bin-length 0 = use exome targets as-is)\ngatk PreprocessIntervals -R ref.fa -L targets.interval_list \\\n    --bin-length 0 --interval-merging-rule OVERLAPPING_ONLY -O preprocessed.interval_list\ngatk AnnotateIntervals -R ref.fa -L preprocessed.interval_list \\\n    --interval-merging-rule OVERLAPPING_ONLY -O annotated.tsv     # GC content for FilterIntervals\n\n# 2. Collect read counts (each BAM)\ngatk CollectReadCounts -R ref.fa -I sample.bam -L preprocessed.interval_list \\\n    --interval-merging-rule OVERLAPPING_ONLY -O sample.counts.hdf5\n\n# 3. Build the panel of normals (tangent-normalization basis)\n# --minimum-interval-median-percentile 5.0 is the GATK CNV tutorial value (tool default 10.0)\ngatk CreateReadCountPanelOfNormals \\\n    -I normal1.counts.hdf5 -I normal2.counts.hdf5 -I normalN.counts.hdf5 \\\n    --annotated-intervals annotated.tsv \\\n    --minimum-interval-median-percentile 5.0 -O cnv.pon.hdf5\n\n# 4. Denoise tumor against the PoN (tangent normalization)\ngatk DenoiseReadCounts -I tumor.counts.hdf5 --count-panel-of-normals cnv.pon.hdf5 \\\n    --standardized-copy-ratios tumor.standardizedCR.tsv \\\n    --denoised-copy-ratios tumor.denoisedCR.tsv\n\n# 5. Allelic counts at common biallelic SNPs (tumor and matched normal)\ngatk CollectAllelicCounts -R ref.fa -I tumor.bam -L common_snps.interval_list \\\n    -O tumor.allelicCounts.tsv\ngatk CollectAllelicCounts -R ref.fa -I normal.bam -L common_snps.interval_list \\\n    -O normal.allelicCounts.tsv\n\n# 6. Joint segmentation of copy ratio and allele fraction\ngatk ModelSegments --denoised-copy-ratios tumor.denoisedCR.tsv \\\n    --allelic-counts tumor.allelicCounts.tsv \\\n    --normal-allelic-counts normal.allelicCounts.tsv \\\n    --output-prefix tumor -O segments\u002F\n\n# 7. Call each segment +\u002F-\u002F0 (simple t-test against the copy-ratio baseline)\ngatk CallCopyRatioSegments -I segments\u002Ftumor.cr.seg -O segments\u002Ftumor.called.seg\n```\n\n`AnnotateIntervals` (step 1) and supplying `--annotated-intervals` to the PoN are frequently skipped — they enable explicit GC-bias correction and are recommended.\n\n## Germline gCNV Pipeline\n\n```bash\n# 1. Determine contig ploidy across the cohort (karyotype + global depth)\ngatk DetermineGermlineContigPloidy -L preprocessed.interval_list \\\n    --interval-merging-rule OVERLAPPING_ONLY \\\n    -I sample1.counts.hdf5 -I sampleN.counts.hdf5 \\\n    --contig-ploidy-priors ploidy_priors.tsv --output-prefix cohort -O ploidy-calls\u002F\n\n# 2. FilterIntervals — remove low-mappability \u002F extreme-GC \u002F low-count intervals\ngatk FilterIntervals -L preprocessed.interval_list --annotated-intervals annotated.tsv \\\n    -I sample1.counts.hdf5 -I sampleN.counts.hdf5 \\\n    --interval-merging-rule OVERLAPPING_ONLY -O filtered.interval_list\n\n# 3. GermlineCNVCaller, cohort mode (builds the model AND calls the cohort)\ngatk GermlineCNVCaller --run-mode COHORT -L filtered.interval_list \\\n    --interval-merging-rule OVERLAPPING_ONLY \\\n    --contig-ploidy-calls ploidy-calls\u002Fcohort-calls \\\n    -I sample1.counts.hdf5 -I sampleN.counts.hdf5 \\\n    --output-prefix cohort -O gcnv-calls\u002F\n\n# 4. Post-process per sample into a genotyped VCF\ngatk PostprocessGermlineCNVCalls \\\n    --calls-shard-path gcnv-calls\u002Fcohort-calls \\\n    --model-shard-path gcnv-calls\u002Fcohort-model \\\n    --contig-ploidy-calls ploidy-calls\u002Fcohort-calls \\\n    --sample-index 0 \\\n    --output-genotyped-intervals sample0.intervals.vcf.gz \\\n    --output-genotyped-segments sample0.segments.vcf.gz \\\n    --output-denoised-copy-ratios sample0.denoisedCR.tsv\n```\n\nCase mode (`--run-mode CASE`) scores a new sample against the cohort `*-model` shards; it must use the **identical** `filtered.interval_list` and the **same scatter count** as the cohort run, or it fails or produces incomparable calls.\n\n## Failure Modes\n\n### Tangent normalization removes a real CNV\n\n**Trigger:** PoN is small (\u003C ~20 normals) or contains samples that share a recurrent CNV (e.g. a common germline CNV, or a PoN accidentally built from tumors).\n\n**Mechanism:** `DenoiseReadCounts` projects the tumor coverage profile onto the subspace spanned by the PoN's principal components. Any copy-number pattern present in that subspace is treated as \"systematic noise\" and subtracted. A CNV shared by PoN members is therefore normalized out of the tumor.\n\n**Symptom:** A known event (recurrent amplification\u002Fdeletion, or a common germline CNV) is absent from `denoisedCR.tsv`; denoised profile is suspiciously flat at that locus.\n\n**Fix:** Build the PoN from >= 20-40 unrelated, tumor-free, process-matched normals. Never put tumors in the PoN. Cross-check against the `standardizedCR.tsv` (pre-tangent) profile — if the event is there but gone after denoising, the PoN ate it.\n\n### Mistaking ModelSegments output for allele-specific integer CN\n\n**Trigger:** Treating `tumor.modelFinal.seg` minor-allele fraction as integer minor copy number, or expecting a purity\u002Fploidy field.\n\n**Mechanism:** GATK somatic CNV models copy ratio and allele fraction but never fits the purity\u002Fploidy grid that converts log-ratio to integer absolute CN.\n\n**Symptom:** No purity\u002Fploidy in any output; \"copy number\" is continuous log2; LOH is a low minor-allele fraction, not an explicit CN-LOH state.\n\n**Fix:** Accept GATK somatic CNV as a relative caller. For integer ASCN, feed the data to PureCN (`segmentationGATK4` reuses GATK segments), FACETS, ASCAT, or Sequenza — see allele-specific-copy-number.\n\n### FilterIntervals silently drops intervals containing real variants\n\n**Trigger:** Aggressive mappability or segmental-duplication cutoffs in `FilterIntervals`.\n\n**Mechanism:** A minimum mappability > 0 or a maximum segmental-duplication content \u003C 1 excludes intervals overlapping segdups and low-mappability regions — exactly where many disease-relevant CNVs (e.g. recurrent genomic-disorder loci flanked by segdups) live.\n\n**Symptom:** Known recurrent CNVs at segdup-mediated loci are never called; the gene of interest has no intervals in `filtered.interval_list`.\n\n**Fix:** Inspect `filtered.interval_list` for genes of interest before calling. Relax mappability\u002Fsegdup cutoffs for targeted analyses; for genomic-disorder loci, depth-based callers are inherently limited near segdups — confirm with an orthogonal assay.\n\n### Raw gCNV output has ~22% precision\n\n**Trigger:** Using unfiltered `GermlineCNVCaller` \u002F `PostprocessGermlineCNVCalls` output for association or de novo analysis.\n\n**Mechanism:** gCNV is tuned for high recall (~95% of rare coding CNVs >= 2 exons) at the cost of precision; raw calls are dominated by false positives.\n\n**Symptom:** Implausibly many rare CNVs per sample; de novo CNV rate far above the expected ~0.01-0.02\u002Fgenome.\n\n**Fix:** Apply the QS (quality score) filter. QS > 100 is a common starting threshold; QS > 1000 reaches ~96% precision. Also apply sample-level filters (call rate, number of CNVs per sample) per Babadi 2023.\n\n### gCNV cohort too small or mismatched\n\n**Trigger:** Cohort mode with \u003C ~100 samples, or a cohort spanning multiple capture kits \u002F library protocols.\n\n**Mechanism:** The Bayesian model needs enough technically similar samples to learn coverage bias; mixed protocols are not separable and the model misattributes batch effects to copy number.\n\n**Symptom:** Unstable calls; many CNVs tracking sequencing batch; model fails to converge.\n\n**Fix:** Use >= 100 process-matched samples per cohort model; split heterogeneous cohorts by capture kit. For \u003C 100 samples, gCNV case mode against an external compatible model, or a cohort caller like ExomeDepth, is more appropriate — see germline-cnv-interpretation.\n\n## Reconciliation: GATK vs Other Callers\n\n| Pattern | Likely cause | Action |\n|---------|--------------|--------|\n| GATK somatic flat where CNVkit calls a focal event | Tangent normalization absorbed it | Check `standardizedCR.tsv`; rebuild PoN without the event |\n| GATK and ASCAT disagree on a \"deletion\" | GATK has no purity model; the event is subclonal or impure | Trust ASCAT\u002FFACETS integer ASCN |\n| gCNV calls a CNV ExomeDepth misses | Different sensitivity profiles; both have poor inter-tool concordance | Require QS filtering + a second caller for rare-CNV claims |\n| gCNV CNV count tracks batch | Cohort mixes protocols | Re-batch by capture kit |\n\n**Operational rule:** GATK somatic CNV output is relative copy ratio — report it as gain\u002Floss\u002Fneutral, not absolute CN, unless downstream-fit by an allele-specific tool. gCNV calls are reportable only after QS and sample-level filtering, and rare-CNV or de novo claims need orthogonal confirmation.\n\n## Quantitative Thresholds\n\n| Threshold | Value | Source \u002F Rationale |\n|-----------|-------|--------------------|\n| PoN size (somatic) | >= 20-40 normals | Larger PoN = stabler tangent subspace; small PoN over-fits |\n| gCNV cohort size | >= ~100 technically matched | Babadi 2023 Nat Genet; model needs coverage-bias signal |\n| gCNV QS for high precision | QS > 1000 -> ~96% precision | Babadi 2023; raw output ~22% precision, ~95% recall |\n| `minimum-interval-median-percentile` | 10.0 default; 5.0 in the GATK CNV tutorial | Drops the lowest-coverage intervals from the PoN |\n| WGS bin length | ~1000 bp | `PreprocessIntervals --bin-length 1000`; WES uses 0 (targets as-is) |\n| Het sites for somatic ModelSegments | >= ~10,000 (WGS) | Sparse hets give noisy minor-allele-fraction segmentation |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| `gatkcondaenv` \u002F theano error in gCNV | gCNV Python env not installed | Install the GATK conda env; gCNV cannot run without it |\n| \"At least one interval must remain\" in FilterIntervals | All intervals filtered out | Relax mappability\u002FGC\u002Fcount cutoffs; check annotated.tsv |\n| Case-mode gCNV fails or gives odd calls | Different scatter count or interval list vs cohort model | Reuse the exact cohort scatter count and `filtered.interval_list` |\n| Denoised profile flat at a known event | Tangent normalization removed it | Rebuild PoN larger, tumor-free; inspect standardizedCR |\n| ModelSegments has few het sites | SNP interval list misses captured regions | Use a common-SNP list intersected with the capture targets |\n| Expecting purity\u002Fploidy in output | Somatic CNV does not estimate them | Use allele-specific-copy-number |\n\n## References\n\n- GATK Best Practices: Somatic copy number variant discovery (CNV). Broad Institute documentation.\n- Babadi M et al 2023. GATK-gCNV enables the discovery of rare copy number variants from exome sequencing data. Nat Genet 55:1589\n- Gao GF, Oh C, Saksena G, Tabak B, Beroukhim R, Getz G et al 2022. Tangent normalization for somatic copy-number inference in cancer genome analysis. Bioinformatics 38:4677 (Tabak is a middle, not first, author).\n\n## Related Skills\n\n- copy-number\u002Fallele-specific-copy-number - Integer ASCN, purity, ploidy (ASCAT\u002FSequenza\u002FFACETS\u002FPureCN)\n- copy-number\u002Fcopy-ratio-segmentation - Segmentation algorithms and depth normalization theory\n- copy-number\u002Fcnvkit-analysis - Read-depth CNV calling for panels and exomes\n- copy-number\u002Fgermline-cnv-interpretation - ACMG\u002FClinGen classification of germline CNV calls\n- copy-number\u002Fcnv-visualization - Plotting GATK denoised ratios and modeled segments\n- copy-number\u002Frecurrent-cnv - Cohort-level recurrent and driver CNV\n- variant-calling\u002Fgatk-variant-calling - GATK SNV\u002Findel pipeline for allelic-count SNP sites\n","## Version Compatibility\n\nReference examples tested with: GATK 4.5+ (gatk4), Python 3.10+ (gcnv conda env), R 4.3+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `gatk --version` then `gatk \u003CToolName> --help` to confirm arguments\n- gCNV requires a working `gatkcondaenv` (theano\u002Ftensorflow stack) — `gatk` will report if the Python environment is missing\n\nGATK 4.5+ gCNV inference defaults are tuned for whole-exome data; whole-genome runs generally need parameter changes. If a tool reports an unrecognized argument, check the help for that exact GATK version rather than retrying.\n\n# GATK CNV Workflows\n\n**\"Call CNVs the GATK way\"** -> GATK has two *separate* CNV workflows that share almost no tools. Picking the wrong one is the most common mistake.\n\n- Somatic CNV: `CollectReadCounts` -> `DenoiseReadCounts` -> `ModelSegments` -> `CallCopyRatioSegments`. Tumor copy-ratio segments, optionally allele-aware.\n- Germline gCNV: `DetermineGermlineContigPloidy` -> `GermlineCNVCaller` -> `PostprocessGermlineCNVCalls`. Per-sample germline CN genotypes (VCF).\n\n## Critical: What GATK Somatic CNV Does NOT Provide\n\n`ModelSegments` + `CallCopyRatioSegments` produce **copy-ratio segments** and a **minor-allele fraction** per segment, and the \"call\" is a simple t-test emitting `+` \u002F `-` \u002F `0`. This is **not** integer allele-specific copy number, **not** tumor purity, and **not** ploidy. Practitioners routinely assume parity with ASCAT\u002FFACETS and there is none. For integer allele-specific CN, purity, ploidy, LOH state, or whole-genome-doubling status, use allele-specific-copy-number (ASCAT, Sequenza, FACETS, or PureCN — PureCN can even reuse the GATK `ModelSegments` segmentation as input).\n\n## Somatic vs Germline — Choosing the Workflow\n\n| Question | Somatic CNV | Germline gCNV |\n|----------|-------------|---------------|\n| Input | One tumor (+ optional matched normal) | A cohort of constitutional samples |\n| Output | Copy-ratio segments, +\u002F-\u002F0 call, minor-allele fraction | Integer germline CN genotype VCF per sample |\n| Normalization | Tangent (projection onto PoN subspace) | PCA batching + Bayesian read-depth model |\n| Cohort needed | PoN of normals for denoising | >= ~100 technically matched samples (cohort mode) |\n| Use for | Tumor SCNAs, focal amplifications\u002Fdeletions | Rare\u002Fde novo germline CNVs, NDD\u002FMendelian cohorts |\n\n## Decision Tree by Scenario\n\n| Scenario | Workflow | Key parameters |\n|----------|----------|----------------|\n| Tumor-normal WGS\u002FWES, want SCNAs | Somatic, with matched-normal allelic counts | `PreprocessIntervals --bin-length 1000` (WGS) or `0` (WES) |\n| Tumor-only somatic CNV | Somatic, no matched-normal allelic counts | Genotype hets in the case sample; expect more no-calls |\n| Rare germline CNV, exome cohort >= 100 | gCNV cohort mode | Run `DetermineGermlineContigPloidy` cohort first |\n| New sample vs an existing gCNV model | gCNV case mode | Must reuse identical scatter count and interval list |\n| Need integer ASCN \u002F purity \u002F ploidy | Neither — escalate | Use allele-specific-copy-number |\n| Targeted panel (\u003C few hundred genes) | Prefer CNVkit | GATK interval models are unstable on tiny panels |\n\n## Somatic CNV Pipeline\n\n```bash\n# 1. Preprocess and annotate intervals (WES: bin-length 0 = use exome targets as-is)\ngatk PreprocessIntervals -R ref.fa -L targets.interval_list \\\n    --bin-length 0 --interval-merging-rule OVERLAPPING_ONLY -O preprocessed.interval_list\ngatk AnnotateIntervals -R ref.fa -L preprocessed.interval_list \\\n    --interval-merging-rule OVERLAPPING_ONLY -O annotated.tsv     # GC content for FilterIntervals\n\n# 2. Collect read counts (each BAM)\ngatk CollectReadCounts -R ref.fa -I sample.bam -L preprocessed.interval_list \\\n    --interval-merging-rule OVERLAPPING_ONLY -O sample.counts.hdf5\n\n# 3. Build the panel of normals (tangent-normalization basis)\n# --minimum-interval-median-percentile 5.0 is the GATK CNV tutorial value (tool default 10.0)\ngatk CreateReadCountPanelOfNormals \\\n    -I normal1.counts.hdf5 -I normal2.counts.hdf5 -I normalN.counts.hdf5 \\\n    --annotated-intervals annotated.tsv \\\n    --minimum-interval-median-percentile 5.0 -O cnv.pon.hdf5\n\n# 4. Denoise tumor against the PoN (tangent normalization)\ngatk DenoiseReadCounts -I tumor.counts.hdf5 --count-panel-of-normals cnv.pon.hdf5 \\\n    --standardized-copy-ratios tumor.standardizedCR.tsv \\\n    --denoised-copy-ratios tumor.denoisedCR.tsv\n\n# 5. Allelic counts at common biallelic SNPs (tumor and matched normal)\ngatk CollectAllelicCounts -R ref.fa -I tumor.bam -L common_snps.interval_list \\\n    -O tumor.allelicCounts.tsv\ngatk CollectAllelicCounts -R ref.fa -I normal.bam -L common_snps.interval_list \\\n    -O normal.allelicCounts.tsv\n\n# 6. Joint segmentation of copy ratio and allele fraction\ngatk ModelSegments --denoised-copy-ratios tumor.denoisedCR.tsv \\\n    --allelic-counts tumor.allelicCounts.tsv \\\n    --normal-allelic-counts normal.allelicCounts.tsv \\\n    --output-prefix tumor -O segments\u002F\n\n# 7. Call each segment +\u002F-\u002F0 (simple t-test against the copy-ratio baseline)\ngatk CallCopyRatioSegments -I segments\u002Ftumor.cr.seg -O segments\u002Ftumor.called.seg\n```\n\n`AnnotateIntervals` (step 1) and supplying `--annotated-intervals` to the PoN are frequently skipped — they enable explicit GC-bias correction and are recommended.\n\n## Germline gCNV Pipeline\n\n```bash\n# 1. Determine contig ploidy across the cohort (karyotype + global depth)\ngatk DetermineGermlineContigPloidy -L preprocessed.interval_list \\\n    --interval-merging-rule OVERLAPPING_ONLY \\\n    -I sample1.counts.hdf5 -I sampleN.counts.hdf5 \\\n    --contig-ploidy-priors ploidy_priors.tsv --output-prefix cohort -O ploidy-calls\u002F\n\n# 2. FilterIntervals — remove low-mappability \u002F extreme-GC \u002F low-count intervals\ngatk FilterIntervals -L preprocessed.interval_list --annotated-intervals annotated.tsv \\\n    -I sample1.counts.hdf5 -I sampleN.counts.hdf5 \\\n    --interval-merging-rule OVERLAPPING_ONLY -O filtered.interval_list\n\n# 3. GermlineCNVCaller, cohort mode (builds the model AND calls the cohort)\ngatk GermlineCNVCaller --run-mode COHORT -L filtered.interval_list \\\n    --interval-merging-rule OVERLAPPING_ONLY \\\n    --contig-ploidy-calls ploidy-calls\u002Fcohort-calls \\\n    -I sample1.counts.hdf5 -I sampleN.counts.hdf5 \\\n    --output-prefix cohort -O gcnv-calls\u002F\n\n# 4. Post-process per sample into a genotyped VCF\ngatk PostprocessGermlineCNVCalls \\\n    --calls-shard-path gcnv-calls\u002Fcohort-calls \\\n    --model-shard-path gcnv-calls\u002Fcohort-model \\\n    --contig-ploidy-calls ploidy-calls\u002Fcohort-calls \\\n    --sample-index 0 \\\n    --output-genotyped-intervals sample0.intervals.vcf.gz \\\n    --output-genotyped-segments sample0.segments.vcf.gz \\\n    --output-denoised-copy-ratios sample0.denoisedCR.tsv\n```\n\nCase mode (`--run-mode CASE`) scores a new sample against the cohort `*-model` shards; it must use the **identical** `filtered.interval_list` and the **same scatter count** as the cohort run, or it fails or produces incomparable calls.\n\n## Failure Modes\n\n### Tangent normalization removes a real CNV\n\n**Trigger:** PoN is small (\u003C ~20 normals) or contains samples that share a recurrent CNV (e.g. a common germline CNV, or a PoN accidentally built from tumors).\n\n**Mechanism:** `DenoiseReadCounts` projects the tumor coverage profile onto the subspace spanned by the PoN's principal components. Any copy-number pattern present in that subspace is treated as \"systematic noise\" and subtracted. A CNV shared by PoN members is therefore normalized out of the tumor.\n\n**Symptom:** A known event (recurrent amplification\u002Fdeletion, or a common germline CNV) is absent from `denoisedCR.tsv`; denoised profile is suspiciously flat at that locus.\n\n**Fix:** Build the PoN from >= 20-40 unrelated, tumor-free, process-matched normals. Never put tumors in the PoN. Cross-check against the `standardizedCR.tsv` (pre-tangent) profile — if the event is there but gone after denoising, the PoN ate it.\n\n### Mistaking ModelSegments output for allele-specific integer CN\n\n**Trigger:** Treating `tumor.modelFinal.seg` minor-allele fraction as integer minor copy number, or expecting a purity\u002Fploidy field.\n\n**Mechanism:** GATK somatic CNV models copy ratio and allele fraction but never fits the purity\u002Fploidy grid that converts log-ratio to integer absolute CN.\n\n**Symptom:** No purity\u002Fploidy in any output; \"copy number\" is continuous log2; LOH is a low minor-allele fraction, not an explicit CN-LOH state.\n\n**Fix:** Accept GATK somatic CNV as a relative caller. For integer ASCN, feed the data to PureCN (`segmentationGATK4` reuses GATK segments), FACETS, ASCAT, or Sequenza — see allele-specific-copy-number.\n\n### FilterIntervals silently drops intervals containing real variants\n\n**Trigger:** Aggressive mappability or segmental-duplication cutoffs in `FilterIntervals`.\n\n**Mechanism:** A minimum mappability > 0 or a maximum segmental-duplication content \u003C 1 excludes intervals overlapping segdups and low-mappability regions — exactly where many disease-relevant CNVs (e.g. recurrent genomic-disorder loci flanked by segdups) live.\n\n**Symptom:** Known recurrent CNVs at segdup-mediated loci are never called; the gene of interest has no intervals in `filtered.interval_list`.\n\n**Fix:** Inspect `filtered.interval_list` for genes of interest before calling. Relax mappability\u002Fsegdup cutoffs for targeted analyses; for genomic-disorder loci, depth-based callers are inherently limited near segdups — confirm with an orthogonal assay.\n\n### Raw gCNV output has ~22% precision\n\n**Trigger:** Using unfiltered `GermlineCNVCaller` \u002F `PostprocessGermlineCNVCalls` output for association or de novo analysis.\n\n**Mechanism:** gCNV is tuned for high recall (~95% of rare coding CNVs >= 2 exons) at the cost of precision; raw calls are dominated by false positives.\n\n**Symptom:** Implausibly many rare CNVs per sample; de novo CNV rate far above the expected ~0.01-0.02\u002Fgenome.\n\n**Fix:** Apply the QS (quality score) filter. QS > 100 is a common starting threshold; QS > 1000 reaches ~96% precision. Also apply sample-level filters (call rate, number of CNVs per sample) per Babadi 2023.\n\n### gCNV cohort too small or mismatched\n\n**Trigger:** Cohort mode with \u003C ~100 samples, or a cohort spanning multiple capture kits \u002F library protocols.\n\n**Mechanism:** The Bayesian model needs enough technically similar samples to learn coverage bias; mixed protocols are not separable and the model misattributes batch effects to copy number.\n\n**Symptom:** Unstable calls; many CNVs tracking sequencing batch; model fails to converge.\n\n**Fix:** Use >= 100 process-matched samples per cohort model; split heterogeneous cohorts by capture kit. For \u003C 100 samples, gCNV case mode against an external compatible model, or a cohort caller like ExomeDepth, is more appropriate — see germline-cnv-interpretation.\n\n## Reconciliation: GATK vs Other Callers\n\n| Pattern | Likely cause | Action |\n|---------|--------------|--------|\n| GATK somatic flat where CNVkit calls a focal event | Tangent normalization absorbed it | Check `standardizedCR.tsv`; rebuild PoN without the event |\n| GATK and ASCAT disagree on a \"deletion\" | GATK has no purity model; the event is subclonal or impure | Trust ASCAT\u002FFACETS integer ASCN |\n| gCNV calls a CNV ExomeDepth misses | Different sensitivity profiles; both have poor inter-tool concordance | Require QS filtering + a second caller for rare-CNV claims |\n| gCNV CNV count tracks batch | Cohort mixes protocols | Re-batch by capture kit |\n\n**Operational rule:** GATK somatic CNV output is relative copy ratio — report it as gain\u002Floss\u002Fneutral, not absolute CN, unless downstream-fit by an allele-specific tool. gCNV calls are reportable only after QS and sample-level filtering, and rare-CNV or de novo claims need orthogonal confirmation.\n\n## Quantitative Thresholds\n\n| Threshold | Value | Source \u002F Rationale |\n|-----------|-------|--------------------|\n| PoN size (somatic) | >= 20-40 normals | Larger PoN = stabler tangent subspace; small PoN over-fits |\n| gCNV cohort size | >= ~100 technically matched | Babadi 2023 Nat Genet; model needs coverage-bias signal |\n| gCNV QS for high precision | QS > 1000 -> ~96% precision | Babadi 2023; raw output ~22% precision, ~95% recall |\n| `minimum-interval-median-percentile` | 10.0 default; 5.0 in the GATK CNV tutorial | Drops the lowest-coverage intervals from the PoN |\n| WGS bin length | ~1000 bp | `PreprocessIntervals --bin-length 1000`; WES uses 0 (targets as-is) |\n| Het sites for somatic ModelSegments | >= ~10,000 (WGS) | Sparse hets give noisy minor-allele-fraction segmentation |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| `gatkcondaenv` \u002F theano error in gCNV | gCNV Python env not installed | Install the GATK conda env; gCNV cannot run without it |\n| \"At least one interval must remain\" in FilterIntervals | All intervals filtered out | Relax mappability\u002FGC\u002Fcount cutoffs; check annotated.tsv |\n| Case-mode gCNV fails or gives odd calls | Different scatter count or interval list vs cohort model | Reuse the exact cohort scatter count and `filtered.interval_list` |\n| Denoised profile flat at a known event | Tangent normalization removed it | Rebuild PoN larger, tumor-free; inspect standardizedCR |\n| ModelSegments has few het sites | SNP interval list misses captured regions | Use a common-SNP list intersected with the capture targets |\n| Expecting purity\u002Fploidy in output | Somatic CNV does not estimate them | Use allele-specific-copy-number |\n\n## References\n\n- GATK Best Practices: Somatic copy number variant discovery (CNV). Broad Institute documentation.\n- Babadi M et al 2023. GATK-gCNV enables the discovery of rare copy number variants from exome sequencing data. Nat Genet 55:1589\n- Gao GF, Oh C, Saksena G, Tabak B, Beroukhim R, Getz G et al 2022. Tangent normalization for somatic copy-number inference in cancer genome analysis. Bioinformatics 38:4677 (Tabak is a middle, not first, author).\n\n## Related Skills\n\n- copy-number\u002Fallele-specific-copy-number - Integer ASCN, purity, ploidy (ASCAT\u002FSequenza\u002FFACETS\u002FPureCN)\n- copy-number\u002Fcopy-ratio-segmentation - Segmentation algorithms and depth normalization theory\n- copy-number\u002Fcnvkit-analysis - Read-depth CNV calling for panels and exomes\n- copy-number\u002Fgermline-cnv-interpretation - ACMG\u002FClinGen classification of germline CNV calls\n- copy-number\u002Fcnv-visualization - Plotting GATK denoised ratios and modeled segments\n- copy-number\u002Frecurrent-cnv - Cohort-level recurrent and driver CNV\n- variant-calling\u002Fgatk-variant-calling - GATK SNV\u002Findel pipeline for allelic-count SNP sites\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","cli","2026-09-20","copy-number\u002Fgatk-cnv\u002FSKILL.md","gatk","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-copy-number-gatk-cnv","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-copy-number-gatk-cnv",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-copy-number-gatk-cnv",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-copy-number-gatk-cnv","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-copy-number-gatk-cnv\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Frun_gatk_cnv.sh","SCRIPT","脚本",3131,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-copy-number-gatk-cnv\u002Fexamples\u002Frun_gatk_cnv.sh",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",4319,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-copy-number-gatk-cnv\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]