Skip to content

Commit

Permalink
Allow for whitespace after commas in metadata lines
Browse files Browse the repository at this point in the history
Fixes #192
  • Loading branch information
martijnvermaat committed Mar 14, 2015
1 parent 3184ce7 commit 5864f83
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 10 deletions.
20 changes: 10 additions & 10 deletions vcf/parser.py
Expand Up @@ -82,25 +82,25 @@ class _vcf_metadata_parser(object):
def __init__(self):
super(_vcf_metadata_parser, self).__init__()
self.info_pattern = re.compile(r'''\#\#INFO=<
ID=(?P<id>[^,]+),
Number=(?P<number>-?\d+|\.|[AGR]),
Type=(?P<type>Integer|Float|Flag|Character|String),
ID=(?P<id>[^,]+),\s*
Number=(?P<number>-?\d+|\.|[AGR]),\s*
Type=(?P<type>Integer|Float|Flag|Character|String),\s*
Description="(?P<desc>[^"]*)"
(?:,Source="(?P<source>[^"]*)")?
(?:,Version="?(?P<version>[^"]*)"?)?
(?:,\s*Source="(?P<source>[^"]*)")?
(?:,\s*Version="?(?P<version>[^"]*)"?)?
>''', re.VERBOSE)
self.filter_pattern = re.compile(r'''\#\#FILTER=<
ID=(?P<id>[^,]+),
ID=(?P<id>[^,]+),\s*
Description="(?P<desc>[^"]*)"
>''', re.VERBOSE)
self.alt_pattern = re.compile(r'''\#\#ALT=<
ID=(?P<id>[^,]+),
ID=(?P<id>[^,]+),\s*
Description="(?P<desc>[^"]*)"
>''', re.VERBOSE)
self.format_pattern = re.compile(r'''\#\#FORMAT=<
ID=(?P<id>.+),
Number=(?P<number>-?\d+|\.|[AGR]),
Type=(?P<type>.+),
ID=(?P<id>.+),\s*
Number=(?P<number>-?\d+|\.|[AGR]),\s*
Type=(?P<type>.+),\s*
Description="(?P<desc>.*)"
>''', re.VERBOSE)
self.contig_pattern = re.compile(r'''\#\#contig=<
Expand Down

0 comments on commit 5864f83

Please sign in to comment.