Skip to content
Snippets Groups Projects
Commit 59798a60 authored by Xavier Grand's avatar Xavier Grand
Browse files

Merge branch 'Alia' into 'master'

Ajout de la fonction sort_index_bam

See merge request testoni-lab/bolero!1
parents 3625d7af 81ad797d
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ process sort_bam { ...@@ -14,7 +14,7 @@ process sort_bam {
path(bam) path(bam)
output: output:
path("*sorted.bam*"), emit: sorted_bam path("*sorted.bam"), emit: sorted_bam
script: script:
""" """
...@@ -29,7 +29,7 @@ process start_position_counts { ...@@ -29,7 +29,7 @@ process start_position_counts {
publishDir "results/${params.start_position_counts_out}", mode: 'copy' publishDir "results/${params.start_position_counts_out}", mode: 'copy'
input: input:
path(bam) tuple path(bam), path(index)
output: output:
path "*", emit: count path "*", emit: count
...@@ -61,4 +61,26 @@ process index_bam { ...@@ -61,4 +61,26 @@ process index_bam {
""" """
samtools index -@ ${task.cpus} ${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