Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • dev
  • master
  • v0.1.0
  • v0.1.2
  • v0.2.0
  • v0.2.1
  • v0.2.2
  • v0.2.3
  • v0.2.4
  • v0.2.5
  • v0.2.6
  • v0.2.7
  • v0.2.8
  • v0.2.9
  • v0.3.0
  • v0.4.0
  • v2.0.0
17 results

Target

Select target project
  • LBMC/regards/nextflow
  • elabaron/nextflow
  • lanani/nextflow
  • mlepetit/nextflow
  • mdjaffar/nextflow
  • LBMC/RMI2/rmi2_pipelines
  • lpicard/nextflow
  • rseraphi/nextflow
  • hregue/nextflow
  • letien02/nextflow
  • mshamjal/nextflow
  • z483801/nextflow
  • fduveau/nextflow
  • cginevra/nextflow
  • dtorresc/nextflow
  • fmortreu/nextflow
  • jshapiro/nextflow
  • carpin/nextflow
  • LBMC/Delattre/JU28_59vs17_SNP
  • jclaud01/nextflow
  • dchalopi/nextflow
  • mvilcot/nextflow
  • mherbett/nextflow
  • lestrada/nextflow
  • nfontrod/nextflow
  • gbenoit/nextflow
  • gyvert/nextflow
  • aguill09/nextflow
  • alapendr/nextflow
  • jprobin/nextflow
  • vvanoost/nextflow
  • jblin/nextflow
  • mparis/nextflow
  • ogandril/nextflow
  • cbourgeo/nextflow
  • ggirau03/nextflow
  • ecombe01/nextflow
  • acorbin/nextflow
  • pberna01/nextflow
  • pmarie01/nextflow
  • rhoury/nextflow
  • lgely/nextflow
  • jvalat/nextflow
  • cfournea/nextflow
  • mprieux/nextflow
  • hpolvech/nextflow
  • LBMC/nextflow
  • mcariou/nextflow
  • z483800/nextflow
  • yjia01/nextflow
  • jkleine/nextflow
  • LBMC/Palladino/RNAseq_nextflow
  • jseimand/nextflow
  • nlecouvr/nextflow-nathan
54 results
Select Git revision
  • master
  • tp_experimental_biologists
2 results
Show changes
Showing
with 344 additions and 472 deletions
params.read_size = 100
params.frag_size = 200
params.step_l = 50
params.min_l = 200
params.max_l = 5000
log.info "bam files : ${params.bam}"
log.info "index files : ${params.index}"
log.info "fasta files : ${params.fasta}"
Channel
.fromPath( params.fasta )
.ifEmpty { error "Cannot find any bam files matching: ${params.fasta}" }
.set { fasta_files }
Channel
.fromPath( params.bam )
.ifEmpty { error "Cannot find any bam files matching: ${params.bam}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { bam_files }
Channel
.fromPath( params.index )
.ifEmpty { error "Cannot find any index files matching: ${params.index}" }
.set { index_files }
process compute_mappability {
tag "${fasta.baseName}"
input:
file index from index_files.collect()
file fasta from fasta_files
output:
file "*.bin" into mappability
file "temp/chr_ids.txt" into chr_ids
script:
"""
generate_multimappability_signal.csh ${fasta} ${params.read_size} ./
bash temp_map_reads.csh
bash temp_process_mapping.csh
"""
}
process music_preprocessing {
tag "${file_id}"
input:
set file_id, file(bam) from bam_files
file chr_ids from chr_ids.collect()
output:
set file_id, "preprocessed/*.tar" into preprocessed_bam_files
script:
"""
mkdir preprocessed
samtools view *.bam | \
MUSIC -preprocess SAM stdin preprocessed/
mkdir preprocessed/sorted
MUSIC -sort_reads preprocessed/ preprocessed/sorted/
mkdir preprocessed/dedup
MUSIC -remove_duplicates ./preprocessed/sorted 2 preprocessed/dedup/
cd preprocessed
tar -c -f ${file_id}.tar *
"""
}
preprocessed_bam_files_control = Channel.create()
preprocessed_bam_files_chip = Channel.create()
preprocessed_bam_files.choice(
preprocessed_bam_files_control,
preprocessed_bam_files_chip ) { a -> a[0] =~ /.*control.*/ ? 0 : 1 }
process music_computation {
tag "${file_id}"
publishDir "results/peak_calling/${file_id}", mode: 'copy'
input:
set file_id, file(control) from preprocessed_bam_files_chip
set file_id_control, file(chip) from preprocessed_bam_files_control.collect()
file mapp from mappability.collect()
output:
file "*" into music_output_forward
file "*.bed" into peaks_forward
script:
"""
mkdir mappability control chip
mv ${mapp} mappability/
tar -xf ${control} -C control/
tar -xf ${chip} -C chip/
MUSIC -get_per_win_p_vals_vs_FC -chip chip/ -control control/ \
-l_win_step ${params.step_l} \
-l_win_min ${params.min_l} -l_win_max ${params.max_l}
MUSIC -get_multiscale_punctate_ERs \
-chip chip/ -control control/ -mapp mappability/ \
-l_mapp ${params.read_size} -l_frag ${params.frag_size} -q_val 1 -l_p 0
ls -l
"""
}
cp results/training/bams/sBNLN18.bam results/training/bams/sBNLN18_control.bam
./nextflow src/nf_modules/music/peak_calling_single.nf \
-c src/nf_modules/music/peak_calling_single.config \
-profile docker \
--fasta "results/training/fasta/*.fasta" \
--bam "results/training/bams/s*.bam" \
--index "results/training/mapping/index/*" \
--read_size 50 --frag_size 300
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "2.18.11"
container_url = "lbmc/picard:${version}"
params.mark_duplicate = "VALIDATION_STRINGENCY=LENIENT REMOVE_DUPLICATES=true"
params.mark_duplicate_out = ""
process mark_duplicate {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.mark_duplicate_out != "") {
publishDir "results/${params.mark_duplicate_out}", mode: 'copy'
}
input:
tuple val(file_id), path(bam)
output:
tuple val(file_id) , path("*.bam"), emit: bam
path "*_report.dupinfo.txt", emit: report
script:
"""
PicardCommandLine MarkDuplicates \
${params.mark_duplicate} \
INPUT=${bam} \
OUTPUT=${bam.baseName}_dedup.bam \
METRICS_FILE=${bam.baseName}_picard_dedup_report.dupinfo.txt &> \
picard_${bam.baseName}.log
"""
}
params.normalize_fasta = ""
params.normalize_fasta_out = ""
process normalize_fasta {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.normalize_fasta_out != "") {
publishDir "results/${params.normalize_fasta_out}", mode: 'copy'
}
input:
tuple val(file_id), path(fasta)
output:
tuple val(file_id), path("results/*.fasta.gz"), emit: fasta
script:
"""
mkdir -p results
PicardCommandLine NormalizeFasta \
I=${fasta} \
O=results/${fasta.simpleName}.fasta
gzip results/${fasta.simpleName}.fasta
"""
}
params.index_fasta = ""
params.index_fasta_out = ""
process index_fasta {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.index_fasta_out != "") {
publishDir "results/${params.index_fasta_out}", mode: 'copy'
}
input:
tuple val(file_id), path(fasta)
output:
tuple val(file_id), path("*.dict"), emit: index
script:
"""
PicardCommandLine CreateSequenceDictionary \
${params.index_fasta} \
REFERENCE=${fasta} \
OUTPUT=${fasta.baseName}.dict
"""
}
params.index_bam = ""
params.index_bam_out = ""
process index_bam {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.index_bam_out != "") {
publishDir "results/${params.index_bam_out}", mode: 'copy'
}
input:
tuple val(file_id), path(bam)
output:
tuple val(file_id), path("*"), emit: index
script:
"""
PicardCommandLine BuildBamIndex \
${params.index_bam} \
INPUT=${bam}
"""
}
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "0.2.4"
container_url = "lbmc/porechop:${version}"
process porechop {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
if (params.porechop_out != "") {
publishDir "results/${params.porechop_out}", mode: 'copy'
}
input:
tuple val(file_id), path(fatsq)
output:
tuple val(file_id), path("*_porechoped.fastq"), emit: porechoped_fastq
script:
"""
porechop -i ${fastq} -o ${file_id}_porechoped.fastq --threads 4
"""
}
\ No newline at end of file
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "0.6.0"
container_url = "lbmc/rasusa:${version}"
include { index_fasta } from "./../samtools/main.nf"
params.sample_fastq = ""
params.sample_fastq_coverage = ""
params.sample_fastq_size = ""
params.sample_fastq_out = ""
workflow sample_fastq {
take:
fastq
fasta
main:
if (params.sample_fastq_coverage == "" && params.sample_fastq_size == ""){
fastq
.set{ final_fastq }
} else {
index_fasta(fasta)
sub_sample_fastq(fastq, index_fasta.out.index)
sub_sample_fastq.out.fastq
.set{ final_fastq }
}
emit:
fastq = final_fastq
}
process sub_sample_fastq {
container = "${container_url}"
label "small_mem_mono_cpus"
tag "$file_id"
if (params.index_fasta_out != "") {
publishDir "results/${params.sample_fastq_out}", mode: 'copy'
}
input:
tuple val(file_id), path(fastq)
tuple val(index_id), path(idx)
output:
tuple val(file_id), path("sub_*.fastq.gz"), emit: fastq
script:
switch(file_id) {
case {it instanceof List}:
file_prefix = file_id[0]
break
case {it instanceof Map}:
file_prefix = file_id.values()[0]
break
default:
file_prefix = file_id
break
}
sample_option = "-c " + params.sample_fastq_coverage
if (params.sample_fastq_size != ""){
sample_option = "-b " + params.sample_fastq_size
}
if (fastq.size() == 2)
"""
rasusa \
-i ${fastq[0]} ${fastq[1]} \
-g ${idx} \
${sample_option} \
-o sub_${fastq[0].simpleName}.fastq.gz sub_${fastq[1].simpleName}.fastq.gz
"""
else
"""
rasusa \
-i ${fastq} \
-g ${idx} \
${sample_option} \
-o sub_${fastq.simpleName}.fastq.gz
"""
}
\ No newline at end of file
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
nextflow.enable.dsl=2
/*
./nextflow src/nf_modules/rasusa/test.nf -c src/nextflow.config -profile docker --fasta "data/tiny_dataset/fasta/tiny_v2.fasta" --fastq "data/tiny_dataset/fastq/tiny_R1.fastq"
./nextflow src/nf_modules/rasusa/test.nf -c src/nextflow.config -profile docker --fasta "data/tiny_dataset/fasta/tiny_v2.fasta" --fastq "data/tiny_dataset/fastq/tiny_R{1,2}.fastq" --coverage 1.0
./nextflow src/nf_modules/rasusa/test.nf -c src/nextflow.config -profile docker --fasta "data/tiny_dataset/fasta/tiny_v2.fasta" --fastq "data/tiny_dataset/fastq/tiny_R1.fastq" --size "1Mb"
*/
params.fastq = "data/fastq/*R{1,2}*"
params.fasta = "data/fasta/*.fasta"
params.coverage = ""
params.size = ""
include { sample_fastq } from "./main.nf" addParams(sample_fastq_coverage: params.coverage, sample_fastq_size: params.size, sample_fastq_out: "sample/")
channel
.fromFilePairs( params.fastq, size: -1)
.set { fastq_files }
channel
.fromPath( params.fasta )
.map { it -> [it.simpleName, it]}
.set { fasta_files }
workflow {
sample_fastq(fastq_files, fasta_files.collect())
}
\ No newline at end of file
#! /bin/sh
# SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
./nextflow src/nf_modules/rasusa/test.nf -c src/nextflow.config -profile docker --fasta "data/tiny_dataset/fasta/tiny_v2.fasta" --fastq "data/tiny_dataset/fastq/tiny_R1.fastq"
./nextflow src/nf_modules/rasusa/test.nf -c src/nextflow.config -profile docker --fasta "data/tiny_dataset/fasta/tiny_v2.fasta" --fastq "data/tiny_dataset/fastq/tiny_R{1,2}.fastq" --coverage 1.0
./nextflow src/nf_modules/rasusa/test.nf -c src/nextflow.config -profile docker --fasta "data/tiny_dataset/fasta/tiny_v2.fasta" --fastq "data/tiny_dataset/fastq/tiny_R1.fastq" --size "1Mb"
\ No newline at end of file
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
withName: index_fasta {
container = "rsem:1.3.0"
}
}
}
psmn {
process{
withName: index_fasta {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "RSEM/1.3.0:SAMtools/1.7"
executor = "sge"
clusterOptions = "-m e -cwd -V"
memory = "30GB"
time = "24h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
}
}
}
params.fasta = "$baseDir/data/bam/*.fasta"
params.annotation = "$baseDir/data/bam/*.gff3"
log.info "fasta files : ${params.fasta}"
Channel
.fromPath( params.fasta )
.ifEmpty { error "Cannot find any fasta files matching: ${params.fasta}" }
.set { fasta_file }
Channel
.fromPath( params.annotation )
.ifEmpty { error "Cannot find any annotation files matching: ${params.annotation}" }
.set { annotation_file }
process index_fasta {
tag "$fasta.baseName"
cpus 4
publishDir "results/mapping/index/", mode: 'copy'
input:
file fasta from fasta_file
file annotation from annotation_file
output:
file "*.index*" into index_files
script:
def cmd_annotation = "--gff3 ${annotation}"
if(annotation ==~ /.*\.gtf$/){
cmd_annotation = "--gtf ${annotation}"
}
"""
rsem-prepare-reference -p ${task.cpus} --bowtie2 \
--bowtie2-path \$(which bowtie2 | sed 's/bowtie2\$//g') \
${cmd_annotation} ${fasta} ${fasta.baseName}.index > \
${fasta.baseName}_rsem_bowtie2_report.txt
"""
}
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
withName: mapping_fastq {
container = "rsem:1.3.0"
}
}
}
psmn {
process{
withName: mapping_fastq {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "RSEM/1.3.0:SAMtools/1.7"
executor = "sge"
clusterOptions = "-m e -cwd -V"
memory = "30GB"
time = "24h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
}
}
}
params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq"
params.index = "$baseDir/data/index/*.index.*"
log.info "fastq files : ${params.fastq}"
log.info "index files : ${params.index}"
Channel
.fromFilePairs( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
Channel
.fromPath( params.index )
.ifEmpty { error "Cannot find any index files matching: ${params.index}" }
.set { index_files }
process mapping_fastq {
tag "$pair_id"
cpus 4
publishDir "results/mapping/quantification/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files
file index from index_files.toList()
output:
file "*" into counts_files
script:
index_id = index[0]
for (index_file in index) {
if (index_file =~ /.*\.1\.bt2/ && !(index_file =~ /.*\.rev\.1\.bt2/)) {
index_id = ( index_file =~ /(.*)\.1\.bt2/)[0][1]
}
}
"""
rsem-calculate-expression --bowtie2 \
--bowtie2-path \$(which bowtie2 | sed 's/bowtie2\$//g') \
--bowtie2-sensitivity-level "very_sensitive" \
-output-genome-bam -p ${task.cpus} \
--paired-end ${reads[0]} ${reads[1]} ${index_id} ${pair_id} \
2> ${pair_id}_rsem_bowtie2_report.txt
if grep -q "Error" ${pair_id}_rsem_bowtie2_report.txt; then
exit 1
fi
"""
}
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
withName: mapping_fastq {
container = "rsem:1.3.0"
}
}
}
psmn {
process{
withName: mapping_fastq {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "RSEM/1.3.0:SAMtools/1.7"
executor = "sge"
clusterOptions = "-m e -cwd -V"
memory = "30GB"
time = "24h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
}
}
}
params.fastq = "$baseDir/data/fastq/*.fastq"
params.index = "$baseDir/data/index/*.index*"
params.mean = 200
params.sd = 100
log.info "fastq files : ${params.fastq}"
log.info "index files : ${params.index}"
log.info "mean read size: ${params.mean}"
log.info "sd read size: ${params.sd}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { fastq_files }
Channel
.fromPath( params.index )
.ifEmpty { error "Cannot find any index files matching: ${params.index}" }
.set { index_files }
process mapping_fastq {
tag "$file_id"
cpus 4
publishDir "results/mapping/quantification/", mode: 'copy'
input:
set file_id, file(reads) from fastq_files
file index from index_files.toList()
output:
file "*" into count_files
script:
index_id = index[0]
for (index_file in index) {
if (index_file =~ /.*\.1\.bt2/ && !(index_file =~ /.*\.rev\.1\.bt2/)) {
index_id = ( index_file =~ /(.*)\.1\.bt2/)[0][1]
}
}
"""
ls -l
rsem-calculate-expression --bowtie2 \
--bowtie2-path \$(which bowtie2 | sed 's/bowtie2\$//g') \
--bowtie2-sensitivity-level "very_sensitive" \
--fragment-length-mean ${params.mean} --fragment-length-sd ${params.sd} \
--output-genome-bam -p ${task.cpus} \
${reads} ${index_id} ${file_id} \
2> ${file_id}_rsem_bowtie2_report.txt
if grep -q "Error" ${file_id}_rsem_bowtie2_report.txt; then
exit 1
fi
"""
}
./nextflow src/nf_modules/rsem/indexing.nf \
-c src/nf_modules/rsem/indexing.config \
-profile docker \
--fasta "data/tiny_dataset/fasta/tiny_v2.fasta" \
--annotation "data/tiny_dataset/annot/tiny.gff"
./nextflow src/nf_modules/rsem/quantification_single.nf \
-c src/nf_modules/rsem/quantification_single.config \
-profile docker \
--index "results/mapping/index/tiny_v2.index*" \
--fastq "data/tiny_dataset/fastq/tiny*_S.fastq"
./nextflow src/nf_modules/rsem/quantification_paired.nf \
-c src/nf_modules/rsem/quantification_paired.config \
-profile docker \
--index "results/mapping/index/tiny_v2.index*" \
--fastq "data/tiny_dataset/fastq/tiny*_R{1,2}.fastq"
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "1.8.0"
container_url = "lbmc/salmon:${version}"
process quantify {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
if (params.salmon_out != "") {
publishDir "results/${params.salmon_out}", mode: 'copy'
}
input:
tuple val(file_id), path(bam)
output:
tuple val(file_id), path("*.sf"), emit: quant
script:
"""
salmon quant -l A --noErrorModel -t XXXXXXXXXX -a ${bam} -p 4 -o ${params.salmon_out}
"""
}
\ No newline at end of file
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
withName: index_bam {
container = "sambamba:0.6.7"
cpus = 4
}
}
}
singularity {
singularity.enabled = true
process {
withName: index_bam {
container = "file://bin/sambamba:0.6.7.sif"
cpus = 4
}
}
}
psmn {
process{
withName: index_bam {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "sambamba/0.6.7"
executor = "sge"
clusterOptions = "-m e -cwd -V"
cpus = 16
memory = "30GB"
time = "24h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
}
}
}
params.bam = "$baseDir/data/bam/*.bam"
log.info "bams files : ${params.bam}"
Channel
.fromPath( params.bam )
.ifEmpty { error "Cannot find any bam files matching: ${params.bam}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { bam_files }
process index_bam {
tag "$file_id"
input:
set file_id, file(bam) from bam_files
output:
set file_id, "*.bam*" into indexed_bam_file
script:
"""
sambamba index -t ${task.cpus} ${bam}
"""
}
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "0.6.7"
container_url = "lbmc/sambamba:${version}"
params.index_bam = ""
process index_bam {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
input:
tuple val(file_id), path(bam)
output:
tuple val(file_id), path("*.bam*"), emit: bam
script:
"""
sambamba index ${params.index_bam} -t ${task.cpus} ${bam}
"""
}
params.sort_bam = ""
process sort_bam {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
input:
tuple val(file_id), path(bam)
output:
tuple val(file_id), path("*.bam*"), emit: bam
script:
"""
sambamba sort -t ${task.cpus} ${params.sort_bam} -o ${bam.baseName}_sorted.bam ${bam}
"""
}
params.split_bam = ""
process split_bam {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
input:
tuple val(file_id), path(bam)
output:
tuple val(file_id), path("*_forward.bam*"), emit: bam_forward
tuple val(file_id), path("*_reverse.bam*"), emit: bam_reverse
script:
"""
sambamba view -t ${task.cpus} ${params.split_bam} -h -F "strand == '+'" ${bam} > \
${bam.baseName}_forward.bam
sambamba view -t ${task.cpus} ${params.split_bam} -h -F "strand == '-'" ${bam} > \
${bam.baseName}_reverse.bam
"""
}
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
withName: sort_bam {
container = "sambamba:0.6.7"
cpus = 4
}
}
}
singularity {
singularity.enabled = true
process {
withName: sort_bam {
container = "file://bin/sambamba:0.6.7.sif"
cpus = 4
}
}
}
psmn {
process{
withName: sort_bam {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "sambamba/0.6.7"
executor = "sge"
clusterOptions = "-m e -cwd -V"
cpus = 4
memory = "30GB"
time = "24h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
}
}
}
params.bam = "$baseDir/data/bam/*.bam"
log.info "bams files : ${params.bam}"
Channel
.fromPath( params.bam )
.ifEmpty { error "Cannot find any bam files matching: ${params.bam}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { bam_files }
process sort_bam {
tag "$file_id"
cpus 4
input:
set file_id, file(bam) from bam_files
output:
set file_id, "*_sorted.bam" into sorted_bam_files
script:
"""
sambamba sort -t ${task.cpus} -o ${file_id}_sorted.bam ${bam}
"""
}