Reader for a VCF v 4.0 file, an iterator returning _Record objects
ALT fields from header
fetch records from a Tabix indexed VCF, requires pysam if start and end are specified, return iterator over positions if end not specified, return individual _Call at start or None
FILTER fields from header
FORMAT fields from header
INFO fields from header
metadata fields from header (string or hash, depending)
Return the next record in the file.
A set of calls at a site. Equivalent to a row in a VCF file.
The standard VCF fields CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO and FORMAT are available as properties.
The list of genotype calls is in the samples property.
The allele frequency of the alternate allele. NOTE 1: Punt if more than one alternate allele. NOTE 2: Denominator calc’ed from _called_ genotypes.
list of alleles. [0] = REF, [1:] = ALTS
1-based end coordinate
pi_hat (estimation of nucleotide diversity) for the site. This metric can be summed across multiple sites to compute regional nucleotide diversity estimates. For example, pi_hat for all variants in a given gene.
Derived from: “Population Genetics: A Concise Guide, 2nd ed., p.45”
John Gillespie.
list of _Calls for each sample ordered as in source VCF
0-based start coordinate
Return the subtype of variant. - For SNPs and INDELs, yeild one of: [ts, tv, ins, del] - For SVs yield either “complex” or the SV type defined
in the ALT fields (removing the brackets). E.g.:
<DEL> -> DEL <INS:ME:L1> -> INS:ME:L1 <DUP> -> DUP
The logic is meant to follow the rules outlined in the following paragraph at:
http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41
“For precisely known variants, the REF and ALT fields should contain the full sequences for the alleles, following the usual VCF conventions. For imprecise variants, the REF field may contain a single base and the ALT fields should contain symbolic alleles (e.g. <ID>), described in more detail below. Imprecise variants should also be marked by the presence of an IMPRECISE flag in the INFO field.”
True if the GT is not ./.
Dictionary of data from the VCF file
The type of genotype. hom_ref = 0 het = 1 hom_alt = 2 (we don;t track _which+ ALT) uncalled = None
The sample name
The _Record for this _Call
An alternative allele record: either replacement string, SV placeholder, or breakend
String to describe the type of variant, by default “SNV” or “MNV”, but can be extended to any of the types described in the ALT lines of the header (e.g. “DUP”, “DEL”, “INS”...)
A breakend which is paired to a remote location on or off the genome
The chromosome of breakend’s mate.
The breakpoint’s connecting sequence.
The orientation of breakend. If the sequence 3’ of the breakend is connected, True, else if the sequence 5’ of the breakend is connected, False.
The coordinate of breakend’s mate.
The orientation of breakend’s mate. If the sequence 3’ of the breakend’s mate is connected, True, else if the sequence 5’ of the breakend’s mate is connected, False.
If the breakend mate is within the assembly, True, else False if the breakend mate is on a contig in an ancillary assembly file.