How am I supposed to write a process that takes mu...
# nostupidquestions
u
How am I supposed to write a process that takes multiple files, each of which has meta? Do I need to use a spreadsheet? I'm thinking of using the output of rmats/prep, which looks like
tuple val(meta), path("*.rmats"), emit: rmats
And I want to feed multiple rmats files to one rmats/post process. I guess I can use path and channels, but do I need a meta? The rmats/post needs to run on ALL input files in one process. Sorry - it feels like this should be obvious, but I've looked at the docs, and nothing seems to click
Maybe collect in the workflow to collect the outputs of rmats/prep, but what should the input or rmats/post look like? Just tuple val(meta), path()? And can I put the list of inputs into a bash array in the script? If there's an example of workflows/modules that do this, you can send a quick link instead of a detailed explanation
I'm going to try https://training.nextflow.io/latest/hello_nextflow/03_hello_workflow/#222-define-inputs-to-collectgreetings, with meta, and see what happen, if that's the right direction Sorry about the spam
p
The output will be the path of all ".rmats" files processed from the given input. You either pass all expected inputs to generate the full list of rmats files, or you have to collect them afterwards. The requirement of "meta" depends on how the post process is defined. The output of
.collect()
would be a list of tuples [[meta1, file1.rmats], [meta2, file2.rmats], ...] or you can group by meta:
Copy code
ch_rmats = RMATS_PREP.out.rmats
    .map { meta, rmats -> [ meta.contrast, rmats ] }
    .groupTuple()
where
meta.contrast
defines the grouping you want to apply for the
RMATS_POST
process
t
The #C0493FQQZ3P pipeline uses rMATS, maybe you can find something in their code that is helpful.