Commit 700105ed by MARIJON Pierre

add span length histograme

parent d490f65b
......@@ -191,6 +191,7 @@ def main(args):
"overlap error", "span"]
result = list()
overlap_series = list()
span_series = list()
read2info, tig2extremity = read_contig_layout(read2tig)
for tig, reads in tig2extremity.items():
......@@ -217,11 +218,25 @@ def main(args):
line.append(ov["id_b"])
line.append(ov["error"])
overlap_series.append(ov["error"])
line.append(ov["span"])
span_series.append(ov["span"])
result.append(line)
pandas.Series(overlap_series).hist().get_figure().savefig(outBaseName+".png")
fig, axes = plt.subplots(ncols=2, figsize=(16, 6))
hist_error = pandas.Series(overlap_series).hist(ax=axes[0])
hist_error.set_xlabel("error rate")
hist_error.set_ylabel("number of overlaps")
hist_error.set_title("Error rate at contig free extremity")
hist_span = pandas.Series(span_series).hist(ax=axes[1])
hist_span.set_xlabel("overlap span length")
hist_span.set_ylabel("number of overlaps")
hist_span.set_title("Overlap span rate at contig free extremity")
fig.savefig(outBaseName+".png", dpi=100)
with open(outBaseName + ".csv", "w") as fd:
writer = csv.writer(fd, delimiter=",")
......
Markdown is supported
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