Detect copy number variations from whole genome sequencing data and generate publication-quality genome-wide CNV plots. Supports CNV calling, segmentation, tumor-normal comparison, and BED format export for cancer genomics and rare disease analysis.
78
73%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./scientific-skills/Data analysis/cnv-caller-plotter/SKILL.mdDetect copy number variations (CNVs) from whole genome sequencing (WGS) data and generate genome-wide visualization plots for cancer genomics, rare disease analysis, and population genetics studies.
⚠️ PLACEHOLDER ALGORITHM — NOT FOR PRODUCTION USE The current CNV calling logic returns hardcoded mock data and does not analyze real BAM files. Do not run on patient samples or use results for clinical or research decisions until a real algorithm (pysam + numpy read-depth calculation) is implemented.
Key Capabilities:
This skill accepts: aligned BAM files (with index .bai) and a reference genome FASTA file. Optional parameters include bin size, output directory, and plot format.
If the request does not involve detecting CNVs from WGS data or generating CNV plots — for example, asking to call SNVs, perform RNA-seq analysis, or interpret clinical genetic reports — do not proceed. Instead respond:
"CNV Caller & Plotter is designed to detect copy number variations from WGS BAM files and generate genome-wide plots. Please provide a BAM file and reference genome. For other genomics tasks, use a more appropriate tool."
PHI Warning: This skill may process patient genomic data. Ensure HIPAA compliance and data use agreements are in place before running on patient samples. For research use, consider anonymizing patient identifiers before processing using tools like ARX or Amnesia for genomic data de-identification.
HIPAA Enforcement: Pass --confirm-hipaa when processing patient genomic data. Without this flag, the script will refuse to proceed: "Patient genomic data detected. Confirm HIPAA compliance with --confirm-hipaa before proceeding."
python -m py_compile scripts/main.py
python scripts/main.py --helpFallback: If --input or --reference is missing, respond: "Required parameters missing. Please provide --input (BAM file) and --reference (reference FASTA). Cannot call CNVs without both."
from scripts.main import CNVCaller
caller = CNVCaller(bin_size=1000)
cnv_calls = caller.call_cnvs(input_file="sample.bam", reference="hg38.fa")
for cnv in cnv_calls:
print(f"{cnv['chrom']}:{cnv['start']}-{cnv['end']} CN={cnv['cn']}")Bin Size Selection:
| Bin Size | Resolution | Coverage Required |
|---|---|---|
| 100 bp | High | >30x |
| 1000 bp | Standard | >15x |
| 10000 bp | Low | >5x |
plot_file = caller.plot_genome_wide(cnv_calls=cnv_calls, output_path="./results", fmt="pdf")| Format | Best For |
|---|---|
| PNG | Web, presentations |
| Publications, printing | |
| SVG | Vector editing |
bed_file = caller.save_bed(cnv_calls, "./output")
# Format: chrom start end CN=3 . .Note: Tumor-normal differential calling is documented but not yet implemented in the placeholder. Until the real algorithm is in place, both tumor and normal inputs return the same placeholder calls. Do not use for somatic CNV identification.
| Category | Tumor CN | Normal CN |
|---|---|---|
| Somatic Amplification | >2 | 2 |
| Somatic Deletion | <2 | 2 |
| Germline CNV | ≠2 | ≠2 |
# Call CNVs from BAM file
python scripts/main.py --input sample.bam --reference hg38.fa
# Custom output and bin size
python scripts/main.py --input sample.bam --reference hg38.fa --output ./results --bin-size 500
# Generate PDF plots
python scripts/main.py --input sample.bam --reference hg38.fa --plot-format pdf
# Patient data (requires HIPAA acknowledgment)
python scripts/main.py --input patient.bam --reference hg38.fa --confirm-hipaa| Parameter | Type | Required | Description |
|---|---|---|---|
--input, -i | string | Yes | Input BAM/VCF file |
--reference, -r | string | Yes | Reference genome FASTA |
--output, -o | string | No | Output directory |
--bin-size | int | No | Bin size for analysis (default 1000) |
--plot-format | string | No | Plot format (png, pdf, svg) |
--confirm-hipaa | flag | Required for patient data | Confirms HIPAA compliance before processing patient genomic data |
Every final response must make these explicit:
--input or --reference is missing, state the missing parameters and request them.samtools index sample.bam--confirm-hipaa, refuse with: "Patient genomic data detected. Confirm HIPAA compliance with --confirm-hipaa before proceeding."scripts/main.py fails, report the failure point and provide manual fallback guidance.--confirm-hipaa flag enforced in scriptca9aaa4
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.