This is the code I have written till mapping. It works fine till the trimming part as it takes 1 input. But throws an error while mapping. Please help in finding where I went wrong.
//rna_script.nf
nextflow.enable.dsl=2
/*
* pipeline input parameters
*/
params.reads = "/home/user2/rnatoy/data/ggal/*.fq"
params.genome = "/home/user2/rnatoy/data/ggal/ggal_1_genome.fa"
params.outdir = 'results'
log.info """\
R N A P I P E L I N E
=============================
genome: ${params.genome}
reads : ${params.reads}
outdir: ${params.outdir}
"""
.stripIndent()
/*
* Step 1. QUALITY CHECK
*/
process QUALITY {
input :
path( params.reads)
script:
"""
fastqc ${params.reads} -o /home/user2/Dock/results
"""
}
/*
* Step 2.TRIM
*/
process TRIM {
input :
path params.reads
output :
path '*trimmed.fq', emit : trimmed
script:
"""
trim_galore ${params.reads} -o /home/user2/Dock/results/TRIMMED/trimmed.fq
"""
}
/*
* Step 3. Builds the genome index required by the mapping process
*/
process buildIndex {
input:
path params.genome
output:
path 'genome.index*', emit : index
"""
bowtie2-build --threads $task.cpus ${params.genome} genome.index
"""
}
/*
* Step 3. ALIGNMENT
*/
process mapping {
input:
path TRIM.out
path buildIndex.out
output:
path "accepted_hits.sam"
"""
bowtie2 -x buildIndex.out ${trimmed} -S accepted_hits.sam
"""
}
workflow {
buildIndex(Channel.fromPath( params.genome ) )
QUALITY(Channel.fromPath( params.reads ) )
TRIM(Channel.fromPath( params.reads ) )
mapping(Channel.fromPath(TRIM.out, buildIndex.out ))
}
this is really wrong.
trim_galore should use the
input
from its ownprocess
and the output shouldn't be a full path.