Commit e6fc97a7 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent ee907684
......@@ -232,13 +232,13 @@ class VCFReader(_AbstractFeatureReader):
if row[7] != '.' :
variation.addattr( 'info', { p.split('=')[0] : autocast(p.split('=')[1]) for p in row[7].split(';') })
format = row[8].split(';')
for i in range(9, len(row)) :
if row[i] != '.' :
sformat = row[i].split(';')
variation.samples.append( Entry(**{ format[i] : autocast(sformat[i]) for i in range(0,len(format)) }) )
format = row[8].split(':')
for lib_infos in range (9,len(row)) :
if row[lib_infos] != '.' and row[lib_infos] != './.' :
sformat = row[lib_infos].split(':')
variation.samples.append( Entry(**{ autocast(format[i]) : autocast(sformat[i]) for i in range(0,len(format)) }) )
else :
variation.samples.append( Entry(**{ format[i] : None for i in range(0,len(format)) }) )
variation.samples.append( Entry(**{ autocast(format[i]) : None for i in range(0,len(format)) }) )
return variation
def _streaming_iter(self):
......@@ -248,7 +248,8 @@ class VCFReader(_AbstractFeatureReader):
row = line.rstrip().split('\t')
if len(row) <= 9 : raise FormatError( 'Invalid number of columns in your vcf header file {0}'.format(len(row)) )
for i in range(9, len(row)) :
self.samples_name.append( ( row[i] , os.path.basename(row[i]) ) )
self.samples_name.append( ( row[i] , os.path.splitext(os.path.basename(row[i]))[0] ) )
continue
yield self._process_line(line)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment