Skip to content
Snippets Groups Projects
Commit 81ad797d authored by aliarifki's avatar aliarifki
Browse files

Ajout de la fonction sort_index_bam

parent bf42a0d6
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ process sort_bam {
path(bam)
output:
path("*sorted.bam*"), emit: sorted_bam
path("*sorted.bam"), emit: sorted_bam
script:
"""
......@@ -29,7 +29,7 @@ process start_position_counts {
publishDir "results/${params.start_position_counts_out}", mode: 'copy'
input:
path(bam)
tuple path(bam), path(index)
output:
path "*", emit: count
......@@ -61,4 +61,26 @@ process index_bam {
"""
samtools index -@ ${task.cpus} ${bam}
"""
}
params.indexed_bam_out =""
process sort_index_bam {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "sorting"
if (params.indexed_bam_out != "") {
publishDir "results/${params.indexed_bam_out}", mode: 'copy'
}
input:
path(bam)
output:
tuple path("*sorted.bam"), path("*.bai"), emit: indexed_bam
script:
"""
samtools sort -@ ${task.cpus} ${bam} -o ${bam.simpleName}_sorted.bam
samtools index -@ ${task.cpus} ${bam.simpleName}_sorted.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