Skip to content

List of length 1 is converted to path #3341

@Mashin6

Description

@Mashin6

Bug report

When creating a list with a single element containing a path, this list gets automatically converted to path object.

Expected behavior and actual behavior

I would expect that list will always be passed to processes as list regardless of number of elements stored in it.

Steps to reproduce the problem

process C {
    input:
    tuple val(id), path(reads)

    script:
    println reads.size()
}

workflow {
    ch_read_pairs = channel.fromFilePairs( params.reads, checkIfExists: true, size: -1  )
    ch_read_pairs.view()
    C( ch_read_pairs )
}

Program output

nextflow run [test.nf](http://test.nf/) --reads *_\{R1,R2\}.fastq returns number of elements

[temp, [/data/temp_R1.fastq, /data/temp_R2.fastq]]
2

nextflow run [test.nf](http://test.nf/) --reads *_\{R1,\}.fastq returns file size

[temp, [/data/temp_R1.fastq]]
62

Environment

  • Nextflow version: 22.04.5
  • Java version: openjdk 17.0.3
  • Operating system: linux
  • Bash version: GNU bash, 4.4.23

Additional context

Same happens when defining channel with Channel.of( [path('temp_R1.fastq')] )

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