Hello there,
I’ve a workflow for RNA seq analysis that contains many processes in it: fastp, align, fusion, mark duplicates, feature count, merge.
I’d like to perform merge after all files are processed through feature counts step.
main.nf
include { rna } from './workflows/rna'
if (params.analysis=="rna"){
rna()
}
rna.nf
include { align} from '../modules/rna/primary/star.nf'
include { arriba} from '../modules/rna/primary/arriba.nf'
include { fastp_rna} from '../modules/rna/primary/fastp_rna.nf'
include { featurecounts} from '../modules/rna/primary/feature.nf'
include { markduplicates} from '../modules/rna/primary/markduplicates.nf'
def createTupleOrString(fileString) {
if (fileString == "NA") {
return "NA"
} else {
return file(fileString)
}
}
workflow rna {
def csvFile = params.input_csvFile //def csvFile = file($params.input_csvFile)
Channel.fromPath(csvFile).splitCsv(header:true)
.branch { it ->
rna: it.tissue == "rna" && it.sequencing_type == "rna"
normal: it.tissue == "normal" && it.sequencing_type == "wes"
tumor: it.tissue == "tumor" && it.sequencing_type == "wes"
}
.set { samples }
fastp_rna (samples.rna)
align(fastp_rna.out.reads_tumor)
markduplicates(align.out.aligned_star)
featurecounts(markduplicates.out.markduplicate_bam)
//wait for all the files/samples to be complete from featurecounts
do_merge() //how do I wait until all files are processed from featurecounts
}
do_merge
doesn’t require any output files from featurecounts
per se.
do_merge will run a script, two input parameters - output folder of feature counts and output directory of the merge script.
Problem statement: I’d like to wait until all files are processed from feature counts and them run merge.
How do I achieve this?
Thanks.