Skip to content

Commit

Permalink
Always return list for FORMAT annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Cooke committed Mar 2, 2019
1 parent 8761c54 commit c6cf3f8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions scripts/train_somatic_random_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ def get_annotation(field, rec, vcf_header):
if field == 'QUAL':
return rec.qual
elif field in rec.format:
if len(vcf_header.samples) > 1:
return [to_float(rec.samples[sample][field]) for sample in vcf_header.samples]
else:
return to_float(rec.samples[vcf_header.samples[0]][field])
return [to_float(rec.samples[sample][field]) for sample in vcf_header.samples]
else:
res = rec.info[field]
if type(res) == tuple:
Expand Down

0 comments on commit c6cf3f8

Please sign in to comment.