I have a tsv file with various columns. One of the columns of interest for me is the run_accession column. It contains accession id of various genome data samples. I want to write a pipeline in Nextflow which reads accession ids from this file using the following command:
cut -f4 datalist.tsv | sed -n 2,11p
Output:
ERR2512385
ERR2512386
ERR2512387
ERR2512388
ERR2512389
ERR2512390
ERR2512391
ERR2512392
ERR2512393
ERR2512394
and feed this list of IDs into Channel.fromSRA method. So far, I have tried this:
#!/home/someuser/bin nextflow
nextflow.enable.dsl=2
params.datalist = "$baseDir/datalist.tsv"
process fetchRunAccession {
input:
path dlist
output:
file accessions
"""
cut -f4 $dlist | sed -n 2,11p
"""
}
process displayResult {
input:
file accessions
output:
stdout
"""
echo "$accessions"
"""
}
workflow {
accessions_p = fetchRunAccession(params.datalist)
result = displayResult(accessions_p)
result.view { it }
}
And I get this error:
Error executing process > 'fetchRunAccession'
Caused by:
Missing output file(s) `accessions` expected by process `fetchRunAccession
If I run just the first process it works well and prints 10 lines as expected. The second process is just a placeholder for the actual fromSRA implementation but I have not been able to use the output of first process as the input of second. I am very new to Nextflow and my code probably has some silly mistakes. I would appreciate any help in this matter.