Skip to content

Commit

Permalink
update to match gap processing of fasta file
Browse files Browse the repository at this point in the history
  • Loading branch information
skoren committed Oct 16, 2024
1 parent 0ffbc34 commit 89a8379
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/scripts/bam_rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import fasta_util as seq
import re

MAX_GAP_SIZE=100000

# rename a bam based on the input scfmap and tig name mapping files
# in the case of scaffolds, offset the start coordinate by the start of the sequence in the scaffold
#
Expand Down Expand Up @@ -54,7 +56,9 @@
for piece in scfmap[clist]:
numn = re.match(r"\[N(\d+)N]", piece)
if numn:
offset += int(numn[1])
#1.5 - approximation for hpc->non-hpc transformation.
tuned_numn = min(round(int(numn[1]) * 1.5), MAX_GAP_SIZE)
offset += int(tuned_numn)
elif piece in lens:
offsets[names[piece]] = offset
#sys.stderr.write("The offset for %s is %s\n"%(names[piece], offset))
Expand Down

0 comments on commit 89a8379

Please sign in to comment.