@mribeirodantas
Thank you for your inputs and example.
Sorry, it’s difficult to create example of such complicated stuff. I’d keep in mind.
I’d like to extend on the example you provided and would try to show what I’d like as an output.
Please be patient, I’ve multiple codes/examples below.
- In your example for BAR instead of the ls, I’d like to concat the files.
I tried below code:
process BAR_cat {
publishDir path: "/data1/users/nextflow/learn_nextflow/merge_feature", mode: 'copy'
debug true
tag "$letter_ids"
input:
tuple val(letter_ids), path(letter_files)
output:
path("merged.txt")
script:
"""
cat ${letter_files} >> "merged.txt"
"""
}
Here it generated all number_letter.txt files in addition to the “merged.txt”. I don’t understand why.
How do I resolve it?
- When I run my code of merge_feature, it runs for all the samples, that is if the collected channel had 19 variables in it, it runs 19 times instead of one.
Below is example of output of the feature_count step:
ch_feature_count=channel.of( [[batch:'SEMA-MM-001', timepoint:'MM-0486-T-01', tissue:'rna', sequencing_type:'rna'],
file('subreadout.fc.txt')
],
[[batch:'SEMA-MM-001', timepoint:'MM-0482-T-01', tissue:'rna', sequencing_type:'rna'],
file('subreadout.fc.txt')
],
[[batch:'SEMA-MM-001', timepoint:'MM-0485-T-01', tissue:'rna', sequencing_type:'rna'],
file('subreadout.fc.txt')
],
[[batch:'SEMA-MM-001', timepoint:'MM-048-T-01', tissue:'rna', sequencing_type:'rna'],
file('subreadout.fc.txt')
]
)
I collect it using following code
ch_feature_count|collect(flat: false) | flatMap() | view
If I send this channel to the merge_feature feature it will run for each timepoint.
Second, I am unable to pick variables from the transpose
ch_feature_count| collect(flat: false) | transpose() | set { transpose_ch }
I’ve tried the following but all fail:
transpose_ch[0]
transpose_ch[[1]]
Please let me know if any other details are needed.