README.rst

The intent of this module is to mimic the csv module in the Python stdlib,
as opposed to more flexible serialization formats like JSON or YAML. vcf
will attempt to parse the content of each record based on the data types
specified in the meta-information lines -- specifically the ##INFO and
##FORMAT lines. If these lines are missing or incomplete, it will check
against the reserved types mentioned in the spec. Failing that, it will just
return strings.

There main interface is the class: Reader. It takes a file-like
object and acts as a reader:

samples and genotype, not being the title of any column, are left lowercase. The format
of the fixed fields is from the spec. Comma-separated lists in the VCF are
converted to lists. In particular, one-entry VCF lists are converted to
one-entry Python lists (see, e.g., Record.ALT). Semicolon-delimited lists
of key=value pairs are converted to Python dictionaries, with flags being given
a True value. Integers and floats are handled exactly as you'd expect:

record.FORMAT will be a string specifying the format of the genotype
fields. In case the FORMAT column does not exist, record.FORMAT is
None. Finally, record.samples is a list of dictionaries containing the
parsed sample column and record.genotype is a way of looking up genotypes
by sample name: