A copy number figure is an argument: the plot type, the y-axis quantity, and where the diploid baseline sits decide what a reader can conclude. This skill covers genome-wide and per-chromosome log2 scatter plots, B-allele-frequency tracks, ideograms, cohort heatmaps, circos views, and caller-native diagnostic plots, and, critically, when each view is the wrong one. The central rule: a depth-only log2 plot cannot show loss of heterozygosity or purity, and misleads outright if the baseline is centered on a non-diploid mode.
pip install matplotlib pandas numpy seaborn
conda install -c bioconda cnvkit # for built-in scatter/diagram/heatmap
# R route: install.packages('ggplot2'); BiocManager::install('karyoploteR')
Inputs: caller output such as CNVkit .cnr/.cns, GATK denoisedCR.tsv/modelFinal.seg, or ASCAT/FACETS/Sequenza segment tables. For allele-specific tracks, a VCF of germline heterozygous SNP B-allele frequencies.
Tell the AI agent what to do: - "Create a genome-wide CNV profile with segments for this sample" - "Make a two-panel log2 + BAF plot so I can see loss of heterozygosity" - "Build a recurrent-CNV heatmap across my 40-sample cohort" - "Diagnose whether my whole-genome-loss plot is a baseline centering artifact" - "Plot chromosome 17 at high resolution to inspect an ERBB2 amplification boundary"
"Create a publication genome-wide log2 profile with colored segments for this CNVkit output, rasterizing the per-bin points so the PDF stays small."
"Plot a combined log2 and B-allele-frequency figure for this tumor and point out any copy-neutral LOH regions."
"Build a cohort CNV heatmap, and choose a bin size that keeps focal drivers like MYC and ERBB2 visible rather than averaging them away."
"Make an ideogram showing which cytobands and genes this sample's CNVs overlap."
"My genome-wide plot shows almost everything as deleted. Decide whether this is real or a diploid-baseline centering error, using the BAF track to check."
"Inspect the ASCAT sunrise plot and FACETS diagnostic plot and tell me whether the purity/ploidy fit is trustworthy."