File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,16 @@ def main(args):
31
31
for n in range (args .top_n ):
32
32
num = str (n + 1 )
33
33
name_field = 'abundance_' + num + '_name'
34
- output_line [name_field ] = bracken_report_sorted [n ]['name' ]
34
+ try :
35
+ output_line [name_field ] = bracken_report_sorted [n ]['name' ]
36
+ except IndexError as e :
37
+ output_line [name_field ] = "None"
35
38
output_fields .append (name_field )
36
39
fraction_total_reads_field = 'abundance_' + num + '_fraction_total_reads'
37
- output_line [fraction_total_reads_field ] = bracken_report_sorted [n ]['fraction_total_reads' ]
40
+ try :
41
+ output_line [fraction_total_reads_field ] = bracken_report_sorted [n ]['fraction_total_reads' ]
42
+ except IndexError as e :
43
+ output_line [fraction_total_reads_field ] = 0.0
38
44
output_fields .append (fraction_total_reads_field )
39
45
40
46
You can’t perform that action at this time.
0 commit comments