Skip to content

Process input path variable contains wrong data type #1653

@marcadella

Description

@marcadella

Bug report

Given a process with the following input:

input:
    path input, stageAs: 'in/*'

where the input channel is a list of paths (Channel.fromPath(params.reads).toSortedList()), I expect that input[0] will return the first path (staged under in), input[1] will return the second path and so on. This is what happens if the input channel contains at least two paths.
For instance, given the two files myFile1.txt and myFile2.txt (piping the channel into view prints: [myFile1.txt, myFile2.txt]), if echo the array input, I get:

  • input[0] = "in/myFile1.txt"
  • input[1] = "in/myFile.txt"
  • input[2] = "null"

However if the input channel contains only one path called myFile.txt (piping the channel into view prints: [myFile.txt]) here is what I get when I echo the input array:

  • input[0] = "in"
  • input[1] = "myFile.txt"
  • input[2] = "null"

while I expected:

  • input[0] = "in/myFile.txt"
  • input[1] = "null"
  • input[2] = "null"

Environment

  • Nextflow version: 20.04.1.5335
  • Java version: 1.8.0_252
  • Operating system: Linux
  • Bash version: GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions