Skip to content

Commit

Permalink
Set vertical line in cumulative plot to new value
Browse files Browse the repository at this point in the history
  • Loading branch information
veghp committed Oct 20, 2024
1 parent 186c88b commit cae8cc7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ediacara/Comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ def __init__(self, reference, alignment):
self.has_errors = False
self.error_type = None # / "small" / "SV" (structural variant)
self.result = None # final decision
self.insert_cutoff = 50 # a small cutoff in bp to ignore small errors

def perform_comparison(self, assembly_path=None, vcf_path=None):
"""Plot coverage and compare reference with a consensus sequence.
Expand Down Expand Up @@ -594,10 +595,8 @@ def get_unaligned_interval_sizes(self):
)
)

# A small cutoff is retained to ignore small errors:
insert_cutoff = 50 # bp
self.insert_pct_above_cutoff = int(
sum(i > insert_cutoff for i in unaligned_interval_sizes)
sum(i > self.insert_cutoff for i in unaligned_interval_sizes)
/ len(unaligned_interval_sizes)
* 100 # report as percent
)
Expand Down Expand Up @@ -749,7 +748,7 @@ def plot_inserts(self):
range(len(self.unaligned_interval_sizes)),
color="red",
)
ax.axvline(x=100, color="grey") # line at 100 bp for guide
ax.axvline(x=self.insert_cutoff, color="grey") # line for guide
ax.set_ylabel("Reads")
ax.set_xlabel("Interval (insert) length [bp]")

Expand Down

0 comments on commit cae8cc7

Please sign in to comment.