Skip to content

Commit

Permalink
record.FILTER is now always a list
Browse files Browse the repository at this point in the history
  • Loading branch information
James Casbon committed Sep 10, 2012
1 parent ae7f9d0 commit 27ee8e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 1 addition & 7 deletions vcf/model.py
Expand Up @@ -151,13 +151,7 @@ def add_format(self, fmt):
self.FORMAT = self.FORMAT + ':' + fmt

def add_filter(self, flt):
if self.FILTER is None \
or self.FILTER == 'PASS'\
or self.FILTER == '.':
self.FILTER = ''
else:
self.FILTER = self.FILTER + ';'
self.FILTER = self.FILTER + flt
self.FILTER.append(flt)

def add_info(self, info, value=True):
self.INFO[info] = value
Expand Down
8 changes: 5 additions & 3 deletions vcf/parser.py
Expand Up @@ -458,9 +458,11 @@ def next(self):
except ValueError:
qual = None

filt = row[6].split(';') if ';' in row[6] else row[6]
if filt == 'PASS':
filt = None
filt = row[6]
if filt == 'PASS' or filt == '.':
filt = []
else:
filt = filt.split(';')
info = self._parse_info(row[7])

try:
Expand Down

0 comments on commit 27ee8e3

Please sign in to comment.