Skip to content

Commit

Permalink
Merge pull request #41 from tcezard/split-prefix
Browse files Browse the repository at this point in the history
Set large index size for large genomes
  • Loading branch information
tcezard authored Nov 4, 2024
2 parents 2091345 + 8bdcc96 commit 0dd4b81
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions variant_to_realignment.nf
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ process alignWithMinimap {
path "reads_aligned.bam", emit: reads_aligned_bam

script:
index_size = ""
if (file(params.newgenome).size() > 4000000000){
index_size = " -I " + file(params.newgenome).size() * 1.1
}
if (flanklength < 500)
"""
# Options used by the 'sr' preset with some modifications:
Expand All @@ -176,15 +180,15 @@ process alignWithMinimap {
# --secondary=yes -N 2 --> allow up to 2 secondary alignments
# -y option will take the comment from the fasta entry and output it
# the awk script will convert this comment in valid SAM tag
minimap2 -k21 -w11 --sr --frag=yes -A2 -B5 -O6,16 --end-bonus 20 -E2,1 -r50 -p.5 -z 800,200\
minimap2 $index_size -k21 -w11 --sr --frag=yes -A2 -B5 -O6,16 --end-bonus 20 -E2,1 -r50 -p.5 -z 800,200\
-f1000,5000 -n2 -m20 -s40 -g200 -2K50m --heap-sort=yes --secondary=yes -N 2 -y \
-a genome.fa ${reads} | \
awk -F '\\t' 'BEGIN{OFS="\\t"}{if(!/^@/){\$NF="vr:Z:"\$NF}; print \$0;}' | \
samtools view -bS - > reads_aligned.bam
"""
else
"""
minimap2 -k19 -w19 -A2 -B5 -O6,16 --end-bonus 20 -E3,1 -s200 -z200 -N50 --min-occ-floor=100 \
minimap2 $index_size -k19 -w19 -A2 -B5 -O6,16 --end-bonus 20 -E3,1 -s200 -z200 -N50 --min-occ-floor=100 \
--secondary=yes -N 2 -y \
-a genome.fa ${reads} | \
awk -F '\\t' 'BEGIN{OFS="\\t"}{if(!/^@/){\$NF="vr:Z:"\$NF}; print \$0;}' | \
Expand Down

0 comments on commit 0dd4b81

Please sign in to comment.