Duplicate path error when two different paths end with the same directory name. #4402
-
Bug reportExpected behavior and actual behaviorWhen in a process I have two separate path parameters with different paths that end with the same directory name nextflow gives an error saying that I have two identically named input parameters even when they are different paths. For example: Say I have a Path A that is path/to/A/practice_dir that is parameter_A and another Path B that is path/toB/practice_dir that is parameter_B When I try to use these in a process, it will read in the two parameter names and say they both clash because they end with practice_dir, even though their paths are separate. I think nextflow should have a way to deal with this issue because I should be able to use two different paths even if they end with the same directory name. Environment
Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Nextflow does have a way to deal with this, but before getting to that, you seem to be failing to understand how it works. It doesn't matter what the absolute path is, as Nextflow will create a task directory for every task and create links for all the input files required for that task. That's why the absolute path is irrelevant here, as the task will only see the final files/directories in the task directory which do have the same name, clashing. You can use process FOO {
debug true
input:
path first_file
path second_file, name: "some_other_name.txt"
output:
stdout
script:
"""
ls
"""
}
workflow {
FOO(file("foo.txt"), file("foo.txt"))
} If you run the Nextflow script above, you'll see the following: N E X T F L O W ~ version 23.09.3-edge
Launching `example.nf` [berserk_leibniz] DSL2 - revision: 4aa7afbb0c
executor > local (1)
[e1/abc224] process > FOO [100%] 1 of 1 ✔
foo.txt
some_other_name.txt |
Beta Was this translation helpful? Give feedback.
-
Ok got it I didn't know about the use of name in the input block for specifying unique file paths when two paths have the same final files/directories thank you. Toby |
Beta Was this translation helpful? Give feedback.
Nextflow does have a way to deal with this, but before getting to that, you seem to be failing to understand how it works. It doesn't matter what the absolute path is, as Nextflow will create a task directory for every task and create links for all the input files required for that task. That's why the absolute path is irrelevant here, as the task will only see the final files/directories in the task directory which do have the same name, clashing. You can use
name
orstageAs
in the input block to have one of them named something else. See the example below: