Skip to content
Browse files

record.FILTER is now always a list

  • Loading branch information...
1 parent ae7f9d0 commit 27ee8e38dc39c98d70f8e42b1cae920a748fdf92 @casbon casbon committed Sep 10, 2012
Showing with 6 additions and 10 deletions.
  1. +1 −7 vcf/model.py
  2. +5 −3 vcf/parser.py
View
8 vcf/model.py
@@ -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
View
8 vcf/parser.py
@@ -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:

0 comments on commit 27ee8e3

Please sign in to comment.
Something went wrong with that request. Please try again.