Skip to content

Commit

Permalink
minimum start value for defining a region is 1, see https://github.co…
Browse files Browse the repository at this point in the history
  • Loading branch information
pontushojer authored Jan 17, 2025
1 parent 8205ff7 commit 51f3877
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/blr/scripts/extract_barcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def chunk(self, c):

# NB: The 'contig_name' should match the contig name on the BAM file
contig_name = re.split(r"_[0-9]+-[0-9]+", str(self.name))[0]
return str(contig_name) + ":" + str(max(0, start)) + "-" + str(end)
return str(contig_name) + ":" + str(max(1, start)) + "-" + str(end)

# ----------------------------------------------------
# For gaps/targets between scaffolds' sequences
Expand All @@ -170,13 +170,13 @@ def chunk(self, c):
self.orient == "-" and self.scaffold == self.right
):
# If the flanksize is set greater than scaffold length this becomes negative
start = max(0, self.slen - c)
start = max(1, self.slen - c)
end = self.slen
# if right_fwd or left_rev
elif (self.orient == "+" and self.scaffold == self.right) or (
self.orient == "-" and self.scaffold == self.left
):
start = 0
start = 1
end = c
return str(self.name) + ":" + str(start) + "-" + str(end)

Expand Down

0 comments on commit 51f3877

Please sign in to comment.