Hi!
I'm currently developing a pipeline for doing RNA-Seq using nextflow. The pipeline is supposed to handle both single end (SE) and paired end (PE) data. I have some questions on how to implement such a switch? Using conditional script exceution seem to works great and is easy to use, but defining different input/output files for each process seem not as straightforward. I tried to run the code below but run into problems.
process fastqc {
module 'bioinfo-tools'
module 'FastQC'
memory '2 GB'
time '1h'
publishDir "$results_path/fastqc"
if (mode == 'SE'){
input:
file read1 from read1
}else if ( mode == 'PE'){
input:
file read1 from read1
file read2 from read2
}
output:
file '*_fastqc.html' into fastqc_html
file '*_fastqc.zip' into fastqc_zip
script:
if ( mode == 'SE')
"""
fastqc -q ${read1}
"""
else if ( mode == 'PE')
"""
fastqc -q ${read1} ${read2}
"""
}I am assuming that the issue is with the input: block, from the docs I gathered that nextflow only allow one input block. I also tested to do something like this as well:
input:
file read1 from read1
if ( mode == 'PE'){
file read2 from read2
}
So the type of input conditions I am trying above seem not to be supported in nextflow. My question is then how I should device the pipeline to handle varying numbers of input output names? An easy solution would to simply have two different nextflow scripts, one for PE and Se respectively. But that's a very redundant and inelegant solution.
Is it better to have entirely different process that are fired based on what mode is specified? That also seems to lead to some code redundancy, but might perhaps be the suggested method?
Is there a suggested way on how to approach this?
Sincerely
Rickard Hammarén
Bioinformatician at the Genomics Applications Development Facility
National Genomics Infrastructure at SciLifeLab Stockholm, Sweden
--
You received this message because you are subscribed to the Google Groups "Nextflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/nextflow.
For more options, visit https://groups.google.com/d/optout.
output:
file '*fq.gz' into trimmed_reads
processB
{
input:
file('*') from trimmed_reads
}process trim {output:file '*.fq.gz' into trimmed_reads"""trim command line .."""}process align {input:file '*' from trimmed_reads"""STAR --readFilesIn *.fq.gz"""}
process align {input:file (reads:'*') from trimmed_reads"""STAR --readFilesIn ${reads}"""}
--
You received this message because you are subscribed to a topic in the Google Groups "Nextflow" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nextflow/_ygESaTlCXg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nextflow+u...@googlegroups.com.