Commit cf611616 authored by Ludovic Legrand's avatar Ludovic Legrand
Browse files

05operateurs

parent 9664fa00
......@@ -3,17 +3,17 @@ nextflow.enable.dsl=2
chanFastq = Channel.fromPath( './rawdata/dev/control/SRR*_{1,2}.fastq.gz', checkIfExists: true)
process collectme {
publishDir('result')
publishDir('result/05operateurs')
input:
path(reads)
output:
path('*.fastq', emit: outfile)
path('collect.log', emit: outfile)
script:
"""
ls -l *.gz > list.fastq
ls -l *.gz > collect.log
"""
}
......
......@@ -4,18 +4,18 @@ test = Channel.fromPath('./rawdata/dev/control/*.fastq.gz')
process gunzip {
publishDir('result')
publishDir('result/05operateurs/')
input:
val(par)
output:
path('log')
path('collect2.log')
script:
println(par.join(' '))
"""
echo $par > log
echo $par > collect2.log
"""
}
......
......@@ -2,8 +2,7 @@ nextflow.enable.dsl=2
chanFastq = Channel.fromPath( './dataset.csv' ).splitCsv(header: ['sample', 'fileR1', 'fileR2'])
//chanFastq.view()
//chanFastq.view { "[channel] csv:$it" }
//chanFastq.map {[it.sample,[it.fileR1, it.fileR2]]}.groupTuple().view()
......@@ -15,11 +14,11 @@ process mock1 {
output:
tuple val(sample), path('*.sam'), emit: outfile
path('*.sh'), emit: debug
tuple val(sample), path('mock.sh'), emit: debug
script:
"""
echo "bwa genome ${read1} ${read2} > ${sample}.sam" > mock.sh
echo "bwa genome ${read1} ${read2} > ${read1}.sam" > mock.sh
touch ${read1}.sam
"""
}
......@@ -31,8 +30,7 @@ process mock2 {
tuple val(sample), path(sam)
output:
tuple val(sample), path('*merged.sam'), emit: outfile
path('*.sh'), emit: debug optional true
tuple val(sample), path('*merged.sam'), path('mock.sh'), emit: outfile
script:
if(sam.collect().size > 1) {
......@@ -43,6 +41,7 @@ touch ${sample}.merged.sam
}
else {
"""
echo "cp ${sam} ${sample}.merged.sam" > mock.sh
touch ${sample}.merged.sam
"""
}
......@@ -51,9 +50,8 @@ touch ${sample}.merged.sam
workflow {
mock1(chanFastq)
//mock1.out.debug.view()
//mock1.out.outfile.view()
mock1.out.debug.view { sample, script -> "[mock1] sample: ${sample} \t script: $script" }
mock1.out.outfile.view { sample, file -> "[mock1] sample: ${sample} \t file:${file}" }
mock2(mock1.out.outfile.groupTuple())
//mock2.out.debug.view()
mock2.out.outfile.view()
mock2.out.outfile.view { sample, file, script -> "[mock2] sample: ${sample} \t file:${file} \t script: ${script}" }
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment