jamescasbon/PyVCF — Issue #2: Options for reporting genotypes.
Author: arq5x
Created: 2012-01-12 15:53:00+00:00
State: open

Currently, we can do the following:

>>> for sample in record.samples:
... print sample['GT']
'1|2'
'2|1'
'2/2'

It would be nice to have a built in method that looks at the ref and alt alleles and converts the encoded genotypes into DNA alleles (GTS == genotypes using Sequence).

>>> for sample in record.samples:
... print sample['GTS']
'A|C'
'C|A'
'C/C'

Also, an option that returns the standard numeric encoding for genotypes: 0 == hom_ref, het == 1, hom_alt == 2, unknown (./.) == -1

>>> for sample in record.samples:
... print sample['GTN']
1
2
0
-1
etc.