I have a simple pipeline:
process test1 {
input:
path a
script:
"""
ls ${a}
"""
}
workflow {
file = file(params.a)
test1(params.a)
}
when I run
touch test.txt
nextflow run test.nf --a test.txt
I get the error:
ERROR ~ Error executing process > 'test1'
Caused by:
Not a valid path value: 'test.txt'
I am not entirely sure why the file is not being staged even though it is present in the same directory where the pipeline is being run.
I tried using absolute paths, and that works, I tried using other files in the same directory and doesnt work, I would assume that this should run as is.
ERROR ~ Error executing process > 'test1' Caused by: Not a valid path value: 'test.txt'
This is because params.a
is a String, but the process is expecting a path
value. Instead, use the file()
method to pass in a filesystem object (i.e. a file). Note that the process input is implicitly wrapped in a value channel:
params.a = 'test.txt'
process test1 {
debug true
input:
path a
script:
"""
ls ${a}
"""
}
workflow {
my_file = file( params.a )
test1( my_file )
}
Results:
$ nextflow run main.nf
N E X T F L O W ~ version 24.04.4
Launching `main.nf` [maniac_albattani] DSL2 - revision: 75134ff125
executor > local (1)
[31/25b733] process > test1 [100%] 1 of 1 ✔
test.txt