Skip to content
Snippets Groups Projects
Verified Commit 324f5505 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

minimap2: add main.nf

parent 364632ef
No related branches found
No related tags found
No related merge requests found
version = "2.17"
container_url = "lbmc/minimap2:${version}"
process index_fasta {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$fasta.baseName"
input:
path fasta
output:
tuple path("${fasta}"), path("*.mmi*"), emit: index
path "*_report.txt", emit: report
script:
memory = "${task.memory}" - ~/\s*GB/
"""
minimap2 -t ${task.cpus} -I ${memory}G -d ${fasta.baseName}.mmi ${fasta}
"""
}
process mapping_fastq {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$pair_id"
input:
tuple path(fasta), path(index)
tuple val(pair_id), path(reads)
output:
tuple val(pair_id), path("*.bam"), emit: bam
path "*_report.txt", emit: report
script:
memory = "${task.memory}" - ~/\s*GB/
memory = memory / (task.cpus + 1.0)
if (reads instanceof List)
"""
minimap2 -ax sr -t ${task.cpus} -K ${memory} ${fasta} ${reads[0]} ${reads[1]} |
samtools view -Sb - > ${pair_id}.bam
"""
else
"""
minimap2 -ax sr -t ${task.cpus} -K ${memory} ${fasta} ${reads} |
samtools view -Sb - > ${reads.baseName}.bam
"""
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment