Hi Kristin,
There are a few critical things:
1. When you create the channel with fromPath, the path gets stripped and val(fa) will only contain the file name without the path. You need file(fa) in the process input.
2. For the output, if you specify --output_basename ${params.output_basename} in the script section, your output file would be written directly into that directory and you don't need an output channel (in fact, the output channel may not be able to find the output file).
The output channel is required, however, if you have a following process that takes this output as its input. In which case, the nextflow way is to write out the output in the current folder (something equivalent of --output_basename . ) and add
publishDir in the process:
https://www.nextflow.io/docs/latest/process.html#publishdir
In output section, I don't know whether
val("./${output_basename}/swap_candidates/${output_basename}.csv", emit: first_csv)
would work, but at least it needs to be
val("./${output_basename}/swap_candidates/${output_basename}.csv"), emit: first_csv
3. In DSL2, the input gets passed into a process through
workflow {
python_script1(fa_file)
python_script2(python_script1.out.first_text)
}So in the process definition, all you need is
input:
file(fa) from fa_file
It takes a bit of fiddling when everyone gets started. Hang in there.
Dan