Skip to content

Commit

Permalink
tuning gap size
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry-Antipov committed Aug 16, 2024
1 parent 4fae57f commit 613634b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/scripts/fasta_combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

import fasta_util as seq

#TODO: constant to verkko.yml_sample
MAX_GAP_SIZE = 100000

mode = None
output_name = None
namedict = dict()
Expand Down Expand Up @@ -86,12 +89,13 @@
prev = ""
for piece in scfmap[clist]:
numn = re.match(r"\[N(\d+)N]", piece)

if numn:
#1.5 - approximation for hpc->non-hpc transformation.
tuned_numn = min(round(int(numn[1]) * 1.5), MAX_GAP_SIZE)
if not seq:
print(f"ERROR:piece {prev} missing from gapped contig {clist}.", file=sys.stderr)
sys.exit(1)
seq += "N" * int(numn[1])
seq += "N" * int(tuned_numn)
elif piece in pieces:
seq += pieces[piece]
elif seq:
Expand Down

0 comments on commit 613634b

Please sign in to comment.