CLI silently drops non-PASS records and SVs; --variant chr contigs fail with GRCh38
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 87
- Forks
- 28
- Avg merge
- 3h 27m
- Merged PRs (30d)
- 27
Description
The CLI silently drops non-PASS records and structural variants, and its own --variant help example fails with --genome GRCh38.
Tested on main at 50eafde (8.0.0), with the #429 import fix applied.
-
Non-PASS records are dropped without notice.
load_vcfdefaults toonly_passing=True, and the CLI has no flag to change that or report it:$ varcode-genes --vcf tests/data/mutect-example.vcf --output-csv out.csv $ wc -l out.csv 11 # the VCF has 4889 records: 10 PASS, 4879 REJECTExpected: an
--include-filteredflag, plus a stderr note such asSkipped 4879 records with FILTER != PASS. -
Structural variants can't be annotated from the CLI.
parse_structural_variantsisn't exposed. The run exits 0 with an empty table, and the warning suggests a Python argument:$ varcode --vcf tests/data/osteosarc_esvee_somatic.vcf --genome GRCh38 --output-csv sv.csv .../varcode/vcf.py:454: UserWarning: Skipped 8 symbolic/breakend allele(s) in .../osteosarc_esvee_somatic.vcf (e.g. <DEL>, <CN0>, <INS:ME:ALU>, breakends). Pass parse_structural_variants=True to load_vcf to load these as StructuralVariant objects. <EffectCollection with 0 elements> $ cat sv.csv variant,contig,start,ref,alt,is_snv,is_transversion,is_transition,gene_id,gene_name,transcript_id,transcript_name,effect_type,effectThe same happens for
tests/data/spec_examples/vcf43_spec_sv.vcf. From Python,load_vcf(..., parse_structural_variants=True).effects()returns 68 effects for the esvee file (GeneFusion for KIF3C, OTX1, PARM1, SEMA6A and others). Expected: a--structural-variantsflag, or SV parsing on by default now that the default annotator routes SVs, and a warning that names the CLI flag. -
--variantwithchrcontigs fails forGRCh37/GRCh38but works forhg19/hg38. The help text's own example ischr1 3848 C G:$ varcode --genome GRCh38 --variant chr12 25245350 C T ValueError: Invalid contig name 'chr12' for reference 'GRCh38' $ varcode --genome hg38 --variant chr12 25245350 C T ... KRAS-201 p.G12DVariantonly stripschrwhen the genome name is a UCSC alias, whileload_vcfconverts it for any genome. The CLI could passconvert_ucsc_contig_names=True, as the VCF path does. The error also appears only after the sequence dictionaries load, not at argument parsing. -
One bad record aborts the whole file. A single reference mismatch or unknown contig raises out of
effects(). The error text says "Pass raise_on_error=False to .effects()", which a CLI user can't do. Expected: a--skip-errorsflag that maps toraise_on_error=Falseand reports failures asFailurerows. -
Help text.
- Typos: "chromsome", "specfied".
--vcf,--maf,--variantand--json-variantscan be repeated, but the help doesn't say so.--genomelistsmm9as an example, butvarcode --genome mm9 --variant 1 3000126 G Tfails withFailed to infer genome assembly name for mm9.mm10andGRCm38work.--genomecan't select a release (#214).--output-csvdoesn't say what the columns are.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CLI entry points and vcf.py's load_vcf and Variant paths, then reproduce the commands using tests/data/mutect-example.vcf, tests/data/osteosarc_esvee_somatic.vcf, and tests/data/spec_examples/vcf43_spec_sv.vcf. Trace how effects() handles filtered records, structural variants, contigs, and errors. Done means the requested flags, diagnostics, contig behavior, and help corrections work without silently losing records.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100