get_MNV needs three files: variant calls, a reference FASTA, and gene annotation. A BAM file is optional.
Pass variant calls with:
--vcf <VCF_FILE>
# or
--tsv <IVAR_TSV_FILE>The supported variant-call inputs are:
- VCF (
.vcfor.vcf.gz) - iVar variants TSV (
.tsv)
Use --vcf for VCF/BCF files and --tsv for iVar variants.tsv files.
Older commands that pass an iVar TSV through --vcf are still auto-detected
when the header has the standard iVar columns.
Use a standard VCF file containing SNV calls.
Requirements:
- VCF contig names must match the FASTA and GFF/GTF contig names.
- REF alleles must match the FASTA sequence.
- Multiallelic records should be pre-split, or run with
--split-multiallelic.
get_MNV can read original depth/frequency metrics from common INFO or FORMAT
fields, including DP, AF, FREQ, AD, AO, and RO.
These input frequency values are kept for reporting as OFREQ. Command-line
frequency filters (--min-snp-frequency, --min-mnv-frequency) use
BAM-derived read support instead, so they require --bam.
Use the TSV produced by ivar variants.
Required columns:
| Column | Meaning |
|---|---|
REGION |
Contig name |
POS |
1-based position |
REF |
Reference base |
ALT |
Alternative base |
Optional columns used when present:
| Column | Used as |
|---|---|
TOTAL_DP |
Original depth (ODP) |
ALT_FREQ |
Original frequency (OFREQ) |
REF_DP, ALT_DP |
Used to infer depth/frequency if needed |
PASS |
Used to keep passing rows |
Filtering:
- If
PASSexists, get_MNV keeps truthy values such asTRUE,PASS,1, orYES. - Rows where
REF == ALTare skipped. - iVar indel notation such as
+Aor-Nis skipped for now. get_MNV is SNV-based. ALT_FREQis reported as original frequency (OFREQ). It is separate from the BAM-derived frequency filters.
Pass the reference with:
--fasta reference.fastaRequirements:
- FASTA record IDs must match the variant contig names.
- Bases must be valid IUPAC DNA bases.
- Duplicate contig names are not allowed.
Provide either --gff or --genes.
Recommended for most datasets:
--gff genes.gff3By default, get_MNV analyzes gene,pseudogene features. For protein-coding
codon annotation, use:
--gff-features CDSImportant details:
- Coordinates are read from columns 4 and 5.
- Strand is read from column 7.
- For
CDSfeatures, phase from column 8 is used when present. - For multi-exon CDS annotations, amino acid numbering is reported against the full transcript when transcript information is available.
- If a GFF/GTF contains multiple transcripts for the same gene, one variant can produce one output line per overlapping transcript.
Gene names are read from common attributes such as gene_name, gene, Name,
locus_tag, gene_id, and ID.
Use --genes for a small, simple annotation file:
--genes genes.tsvFour-column format:
GeneName GeneStart GeneEnd Strand
Example:
Rv0007_Rv0007 9914 10828 +
Rv0008c_Rv0008c 11874 12311 -
Optional five-column format with phase:
GeneName GeneStart GeneEnd Strand Phase
Phase can be 0, 1, 2, or .. If the phase column is omitted, it defaults
to 0.
Limitations of TSV annotation:
- It has no contig column.
- For multi-contig data, use GFF/GTF or restrict the run with
--chrom.
Pass BAM reads with:
--bam reads.bamWhen a BAM is provided, get_MNV calculates:
- SNP read support
- MNV haplotype read support
- Total depth and frequency
- Forward/reverse strand counts
- Optional strand-bias statistics
Requirements:
- BAM must be sorted.
- BAM must be indexed (
.bai). - BAM contig names must match the variant file and FASTA.
- Duplicate, secondary, and supplementary reads are ignored.
All input files must agree on contig names:
variant contig == FASTA record ID == GFF sequence ID == BAM reference name
For example, chr1 and 1 are different names. Rename or normalize inputs
before running get_MNV.