Permalink
Browse files

Merge pull request #1 from brentp/master

fix reserved format lookup, Support for Number=A in INFO
  • Loading branch information...
jdoughertyii committed Oct 4, 2011
2 parents 8641e49 + a86365e commit e66f6b50cdb8457e5540b348ef878e49d41a01b7
Showing with 5 additions and 4 deletions.
  1. +5 −4 vcf.py
View
9 vcf.py
@@ -119,7 +119,7 @@ def __init__(self, aggressive=False):
self.aggro = aggressive
self.info_pattern = re.compile(r'''\#\#INFO=<
ID=(?P<id>[^,]+),
- Number=(?P<number>\d+|\.),
+ Number=(?P<number>\d+|\.|[AG]),
Type=(?P<type>Integer|Float|Flag|Character|String),
Description="(?P<desc>[^"]*)"
>''', re.VERBOSE)
@@ -129,7 +129,7 @@ def __init__(self, aggressive=False):
>''', re.VERBOSE)
self.format_pattern = re.compile(r'''\#\#FORMAT=<
ID=(?P<id>.+),
- Number=(?P<number>\d+|\.),
+ Number=(?P<number>\d+|\.|[AG]),
Type=(?P<type>.+),
Description="(?P<desc>.*)"
>''', re.VERBOSE)
@@ -361,7 +361,7 @@ def _parse_samples(self, samples, samp_fmt):
entry_type = self.formats[fmt].type
except KeyError:
try:
- entry_type = RESERVED_FORMATs[fmt]
+ entry_type = RESERVED_FORMAT[fmt]
except KeyError:
entry_type = 'String'
@@ -389,7 +389,7 @@ def next(self):
if row[2] != '.':
ID = row[2]
- else:
+ else:
ID = None if self.aggro else row[2]
ref = row[3]
@@ -431,6 +431,7 @@ def main():
##INFO=<ID=AA,Number=1,Type=String,Description="Ancestral Allele">
##INFO=<ID=DB,Number=0,Type=Flag,Description="dbSNP membership, build 129">
##INFO=<ID=H2,Number=0,Type=Flag,Description="HapMap2 membership">
+ ##INFO=<ID=AC,Number=A,Type=Integer,Description="Total number of alternate alleles in called genotypes">
##FILTER=<ID=q10,Description="Quality below 10">
##FILTER=<ID=s50,Description="Less than 50% of samples have data">
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">

0 comments on commit e66f6b5

Please sign in to comment.