openvax / openvax/varcode

CLI silently drops non-PASS records and SVs; --variant chr contigs fail with GRCh38

Open
#433 0 comments 0 reactions 0 assignees View on GitHub

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.

  1. Non-PASS records are dropped without notice. load_vcf defaults to only_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 REJECT
    

    Expected: an --include-filtered flag, plus a stderr note such as Skipped 4879 records with FILTER != PASS.

  2. Structural variants can't be annotated from the CLI. parse_structural_variants isn'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,effect
    

    The 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-variants flag, or SV parsing on by default now that the default annotator routes SVs, and a warning that names the CLI flag.

  3. --variant with chr contigs fails for GRCh37/GRCh38 but works for hg19/hg38. The help text's own example is chr1 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.G12D
    

    Variant only strips chr when the genome name is a UCSC alias, while load_vcf converts it for any genome. The CLI could pass convert_ucsc_contig_names=True, as the VCF path does. The error also appears only after the sequence dictionaries load, not at argument parsing.

  4. 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-errors flag that maps to raise_on_error=False and reports failures as Failure rows.

  5. Help text.

    • Typos: "chromsome", "specfied".
    • --vcf, --maf, --variant and --json-variants can be repeated, but the help doesn't say so.
    • --genome lists mm9 as an example, but varcode --genome mm9 --variant 1 3000126 G T fails with Failed to infer genome assembly name for mm9. mm10 and GRCm38 work.
    • --genome can't select a release (#214).
    • --output-csv doesn't say what the columns are.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.