how to pass paired reads to another process in another script #4017
-
Hi, one.nf params.outdir = 'results'
params.reads1 = "/Users/name/Downloads/tiny/normal/*_R1_xxx.fastq.gz"
params.reads2 = "/Users/name/Downloads/tiny/normal/*_R2_xxx.fastq.gz"
println "reads: $params.reads1"
println "reads: $params.reads2"
Channel.fromPath(params.reads1,checkIfExists: true).view()
Channel.fromPath(params.reads2,checkIfExists: true).view()
include { fastp } from '/Users/name/Documents/name/nextflow_scripts/fastp.nf'
fqpairs_ch=channel.fromFilePairs('/Users/sariys01/Downloads/tiny/normal/*_R{1,2}_xxx.fastq.gz')
process check {
output:
tuple val(fqpairs_ch)
"""
echo "hello from command line \n"
"""
}
workflow {
check().view()
fastp(fqpairs_ch).view()
} fastp.nf params.outdir = "./results"
process fastp() {
tag "$sample_id"
input:
tuple val(sample_id), file(x), file(x1) from fqpairs_ch
output:
println ("$sample_id")
script:
"""
mkdir fastp_trimmed
fastp \
--correction \
--cut_tail \
--disable_trim_poly_g \
--length_required 50 \
--qualified_quality_phred 20 \
--thread 12 \
--trim_poly_x \
--unqualified_percent_limit 20 \
-i ${x[0]} -I ${x[1]} \
-o fastp_trimmed/joinedfiles.dat_${x[0]} -O fastp_trimmed/joinedfiles.dat_${x[1]}
"""
} Error:
How do I capture the paired reads in fastp process defined in another script? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
@bentsherman Can you please assist? I am new to nextflow and is complicated to understand. |
Beta Was this translation helpful? Give feedback.
-
Hi @sariya , you are mixing DSL1 and DSL2 syntax. In your |
Beta Was this translation helpful? Give feedback.
-
@bentsherman Thanks for editing and reviewing code. It works, however there's one concern - it doesn't make directory as indicated at the working directory level. It errors out due to mismatch FASTQ paired end reads; however, not creating directory is mysterious.
Next, how do I keep process in a separate file and send parameters? Thank you again. |
Beta Was this translation helpful? Give feedback.
-
@bentsherman Thank you for your time and replies. |
Beta Was this translation helpful? Give feedback.
I gave another look and I am seeing multiple errors, so I will just correct the code and show you what I changed:
fastp
process namex0
andx1
instead ofx[0]
andx[1]
println
from process output, emit your output files here instead