Skip to content

Commit

Permalink
Allow minimap's -f parameter to be set
Browse files Browse the repository at this point in the history
From minimap2's --help:

-f FLOAT     filter out top FLOAT fraction of repetitive minimizers [0.0002]

Setting this higher allows us to handle input references with large
numbers of repetitive sequences.

Also bump up minimap2 memory/cpu resources on milton.
  • Loading branch information
mcmero committed May 15, 2024
1 parent 76c4c5c commit 26d1c52
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .test/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ params {

// count partially mapped reads
lenient_counts = false

// minimap -f parameter (filter out fraction or number of repetitive minimisers)
// set this to a higher value if using a reference with a large number of
// repetitive sequences
minimap_f = 0.0002
}

//SQL DB Plugin
Expand Down
7 changes: 4 additions & 3 deletions modules/count.nf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ process CountGuides {
script:
def outCounts = "${sampleName}_guide_counts.txt"
def lenientFlag = params.lenient_counts ? "--lenient" : ""
def extraThreads = task.cpus - 1
/*
count collation is a hacky bash script to get collated output,
the script pastes the count files together, and then cuts out
Expand All @@ -54,10 +55,10 @@ process CountGuides {
do
sample=\${fastq%.fastq*}
minimap2 -ax map-ont -N 1 \
minimap2 -ax map-ont -N 1 -t ${task.cpus} -f ${params.minimap_f} \
${guides_index} \$fastq | \
samtools view -S -b | \
samtools sort -o \${sample}.bam
samtools view -S -b -@ ${extraThreads} | \
samtools sort -@ ${extraThreads} -o \${sample}.bam
count_guides.py \${sample}.bam ${params.guides_fasta} ${lenientFlag} > \${sample}_counts.txt
done
Expand Down
11 changes: 10 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ params {

// count partially mapped reads
lenient_counts = false

// minimap -f parameter (filter out fraction or number of repetitive minimisers)
// set this to a higher value if using a reference with a large number of
// repetitive sequences
minimap_f = 0.0002
}

//SQL DB Plugin
Expand Down Expand Up @@ -73,10 +78,14 @@ profiles {
memory = { 8.GB * task.attempt }
time = '12h'
errorStrategy = { 'retry' }
maxRetries = 4
maxRetries = 3
withLabel:SplitCode {
module = 'splitcode/0.28.3'
}
withLabel:CountGuides {
cpus = 8
memory = { 64.GB * task.attempt }
}
}
}
test {
Expand Down
6 changes: 6 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@
"fa_icon": "fas fa-cog",
"default": "",
"hidden": true
},
"minimap_f": {
"type": "float",
"default": 0.002,
"description": "Minimap2 -f parameter (default = 0.002). Set this higher for highly repetitive sequences. Accepts integer threshold or fraction.",
"hidden": true
}
}
}
Expand Down

0 comments on commit 26d1c52

Please sign in to comment.