I’m doing a small Nextflow script for practice. My working directory is:
.
├── metadata_a.txt
├── metadata_b.txt
├── metadata_c.txt
└── parallel.nf
0 directories, 4 files
With my Nextflow script (parallel.nf), I’m trying to cat each metadata file and show the name of each one.
#!/usr/bin/env nextflow
process READFILE{
input:
tuple val(name), path(file)
output:
stdout
"""
echo \$(cat $file) of $name
"""
}
workflow {
input_ch = Channel.fromFilePairs('./metadata_*.txt')
READFILE(input_ch).view()
}
But my pipeline even actually didn’t run:
Launching `parallel.nf` [romantic_austin] DSL2 - revision: 4a80e4e585
[- ] process > READFILE -
Does anyone know about this situation? Please give me some help, thanks.
>Solution :
The workflow ran, but your input channel was empty. The fromFilePairs factory method just needs a size parameter to specify the number of expected input files. Otherwise a pair of files is expected. I think what you want is:
workflow {
input_ch = Channel.fromFilePairs('./metadata_*.txt', size: 1)
READFILE(input_ch)
READFILE.out.view()
}