So my initial input file is an annotation file which contains the information for all the downstream process.
So this is my step1.nf
nextflow.enable.dsl = 2
// Define the default annotation file
params.annotation_file = 'sample_annot.txt'
annotation_ch = Channel.fromPath(params.annotation_file)
// Define the process to parse the annotation file
process parse_annotation {
tag "$annotation_file"
publishDir "results/", mode: 'copy'
input:
path annotation_file
output:
path "sample.csv", emit: parsed_annotation
script:
"""
python3 /home/punit/temp/parse_annotation.py -f $annotation_file
"""
}
// Define the workflow
workflow {
parse_annotation(annotation_ch)
}
Now this gives me desired output which is inside the result folder which is a .csv file.
Next step is use that generated output .csv file as input for the sample_parsing script which script is sample_parse.py
which takes two argument as input, one is the .csv file which is generated in the result folder and other is the original annotation file which is given as here params.annotation_file = 'sample_annot.txt'
So far till i have managed to get the first step for the next part in the same nextflow how do i do it.
As i did it separately in other words i generated the first part and did the second in another nextflow script, but my goal is to do it together or in a single nextflow script
Will it be inside the same workflow or another one? i did see examples but it bit confusing so far, as i try to wrap my head around.
Any suggestion or help would be really appreciated