Skip to content

Logic of keepHeader option of splitText is reversed. #5732

Open
@mahesh-panchal

Description

@mahesh-panchal

Bug report

When you use splitText on a file with the keepHeader option, it does the opposite of what it's supposed to do.

Expected behavior and actual behavior

keepHeader: true removes the header, and keepHeader:false keeps the header.
The expected behaviour is that it's the other way around.

Steps to reproduce the problem

workflow {
    ch_in = Channel.fromPath('data/*tsv', checkIfExists: true)
    .map { it.splitText( keepHeader: false ).join('') }
    .view()
}

sample_A_1.tsv:

workflow {
    ch_in = Channel.fromPath('data/*tsv', checkIfExists: true)
    .map { it.splitText( keepHeader: false ).join('') }
    .view()
}

Program output

 $ nextflow run main.nf 

 N E X T F L O W   ~  version 24.10.4

Launching `main.nf` [sharp_gates] DSL2 - revision: 54c05059bf

Col1    Col2
sampleA1  tagA
sampleA1  tagB
sampleA1  tagC

Environment

  • Nextflow version: 24.10.4
  • Java version: openjdk 17.0.14-internal 2025-01-21
  • Operating system: Linux
  • Bash version: GNU bash, version 5.1.16(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