Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch when no coverage from samtools #65

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ariba/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,14 @@ def _report_lines_for_one_contig(cluster, contig_name, ref_cov_per_contig, pymum
str(cluster.assembly_compare.percent_identities[contig_name]) if contig_name in cluster.assembly_compare.percent_identities else '0',
contig_name,
str(contig_length), # 9 length of scaffold matching reference
str(round(cluster.total_contig_depths[contig_name] / contig_length, 1)), # 10 mean mapped read depth
]

# it's possible that there is no read depth on an assembled contig
if contig_name in cluster.total_contig_depths:
common_first_columns.append(str(round(cluster.total_contig_depths[contig_name] / contig_length, 1)))
else:
common_first_columns.append('0')

if cluster.ref_sequence.id in cluster.refdata.metadata and len(cluster.refdata.metadata[cluster.ref_sequence.id]['.']) > 0:
free_text_column = ';'.join([x.free_text for x in cluster.refdata.metadata[cluster.ref_sequence.id]['.']])
else:
Expand Down