Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of length 1 is converted to path #3341

Closed
Mashin6 opened this issue Nov 2, 2022 · 1 comment
Closed

List of length 1 is converted to path #3341

Mashin6 opened this issue Nov 2, 2022 · 1 comment

Comments

@Mashin6
Copy link

Mashin6 commented Nov 2, 2022

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')] )

@bentsherman
Copy link
Member

Duplicate of #969, also related to #1236 and #2425. See this comment for the planned solution: #2425 (comment)

@bentsherman bentsherman closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants