Records¶
Contents
vcfpy.Record¶
-
class
vcfpy.
Record
(CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO, FORMAT, calls)[source]¶ Represent one record from the VCF file
Record objects are iterators of their calls
-
ALT
= None¶ A list of alternative allele records of type
AltRecord
-
CHROM
= None¶ A
str
with the chromosome name
-
FILTER
= None¶ A list of strings for the FILTER column
-
FORMAT
= None¶ A list of strings for the FORMAT column
-
ID
= None¶ A list of the semicolon-separated values of the ID column
-
INFO
= None¶ An OrderedDict giving the values of the INFO column, flags are mapped to
True
-
POS
= None¶ An
int
with a 1-based begin position
-
QUAL
= None¶ The quality value, can be
None
-
REF
= None¶ A
str
with the REF value
-
add_format
(key, value=None)[source]¶ Add an entry to format
The record’s calls
data[key]
will be set tovalue
if not yet set and value is notNone
. If key is already in FORMAT then nothing is done.
-
affected_end
¶ Return affected start position in 0-based coordinates
For SNVs, MNVs, and deletions, the behaviour is based on the start position and the length of the REF. In the case of insertions, the position behind the insert position is returned, yielding a 0-length interval together with :py:method:`affected_start`
-
affected_start
¶ Return affected start position in 0-based coordinates
For SNVs, MNVs, and deletions, the behaviour is the start position. In the case of insertions, the position behind the insert position is returned, yielding a 0-length interval together with :py:method:`affected_end`
-
begin
= None¶ An
int
with a 0-based begin position
-
call_for_sample
= None¶ A mapping from sample name to entry in self.calls
-
calls
= None¶ A list of genotype
Call
objects
-
end
= None¶ An
int
with a 0-based end position
-
vcfpy.Call¶
-
class
vcfpy.
Call
(sample, data, site=None)[source]¶ The information for a genotype callable
By VCF, this should always include the genotype information and can contain an arbitrary number of further annotation, e.g., the coverage at the variant position.
-
called
= None¶ whether or not the variant is fully called
-
data
= None¶ an OrderedDict with the key/value pair information from the call’s data
-
gt_alleles
= None¶ the allele numbers (0, 1, ...) in this calls or None for no-call
-
gt_bases
¶ Return the actual genotype alleles, e.g. if VCF genotype is 0/1, could return A/T
-
gt_type
¶ The type of genotype, mapping is
- hom_ref = 0
- het = 1
- hom_alt = 2 (which alt is untracked)
- uncalled =
None
-
is_filtered
¶ Return
True
for filtered calls
-
is_het
¶ Return
True
for filtered calls
-
is_phased
¶ Return
True
for phased calls
-
is_variant
¶ Return
True
for filtered calls
-
phased
¶ Return boolean indicating whether this call is phased
-
plodity
= None¶ the number of alleles in this sample’s call
-
sample
= None¶ the name of the sample for which the call was made
-
site
= None¶ the
Record
of thisCall
-
vcfpy.AltRecord¶
-
class
vcfpy.
AltRecord
(type_=None)[source]¶ An alternative allele Record
Currently, can be a substitution, an SV placeholder, or breakend
-
type
= None¶ String describing the type of the variant, could be one of SNV, MNV, could be any of teh types described in the ALT header lines, such as DUP, DEL, INS, ...
-