I suggest to add a try / except clause around the output_file_write() statement so that summary.py does not fail when there are samples with 0% coverage. Of course, these samples are not useful, but you'd normally not be able to filter these out until after the run. Code change suggestion below:
for k in dic_dp:
dpt=dic_dp[k]
dpt=str(dpt[:-1])
try:
output_file.write(str(k)+"\t"+str(dic_cov[k])+"\t"+str(dpt) + ...... +str(dic_prio[k])+"\n")
except KeyError as e:
print 'KeyError: reason "%s"' % str(e)
pass
I suggest to add a try / except clause around the output_file_write() statement so that summary.py does not fail when there are samples with 0% coverage. Of course, these samples are not useful, but you'd normally not be able to filter these out until after the run. Code change suggestion below: