-
Notifications
You must be signed in to change notification settings - Fork 776
Closed
Labels
Description
Bug report
Minimal example:
input:
file input_files from featureCounts_to_merge.collect()
output:
file 'merged_gene_counts.txt'
script:
//if we only have 1 file, just use cat and pipe output to csvtk. Else join all files first, and then remove unwanted column names.
def single = input_files instanceof Path ? 1 : input_files.size()
def merge = (single == 1) ? 'cat' : 'csvtk join -t -f "Geneid,Start,Length,End,Chr,Strand,gene_name"'
"""
$merge $input_files | csvtk cut -t -f "-Start,-Chr,-End,-Length,-Strand" | sed 's/Aligned.sortedByCoord.out.markDups.bam//g' > merged_gene_counts.txt
"""Expected behavior and actual behavior
I expect input_files.size() to return the size of the list, e.g. having n elements.
Actually, this depends:
- if its just one element, it returns a Path object, so path.size() returns the length of the path as a String
- if its multiple elements, it returns the list size, as expected
Steps to reproduce the problem
See above testcase
Program output
Environment
- Nextflow version: 18.10.1
- Java version: 1.8
- Operating system: no-arch
Reactions are currently unavailable