Not related to meta-omics, but to pipeline-chainin...
# meta-omics
n
Not related to meta-omics, but to pipeline-chaining. I assume you have solved this: how do you generate a samplesheet for a downstream pipeline that contains the published output?
j
You could use the index from workflow outputs, but it requires some careful control and consideration over the structure of your publications
this 1
m
same for #C024915L4KB and #CL88J906S (currently a process, but I just rewrote it the sarek way)
n
I see, I was trying something similar as sarek, but in a different (wrong) way ;D
m
different than sarek is not wrong, I do like different to be honest
n
Well, it didnt work, so...
m
checkout what I did in #CL88J906S https://github.com/nf-core/demultiplex/pull/411
j
My issue with a process approach is that you have to write the output paths twice, so there's a chance something can go wrong. I wish the index system was more flexible, at the moment it is not great
n
I am acutally not using a process
m
I do not like a process approach because it's wasting a process for just basic text processing that easily done in groovy
n
Here is what I am trying
Copy code
ch_assembly_manifest = ch_main_scaffolded
        .map { it ->
            def meta = it.meta
                // A list of filenames, corresponding and the candidate output folder
                [
                [ meta.id, meta.scaffolds ? meta.scaffolds.ragtag ?: null : null,           'scaffold/ragtag'     ],
                [ meta.id, meta.scaffolds ? meta.scaffolds.hic ?: null : null,              'scaffold/hic/yahs'   ],
                [ meta.id, meta.scaffolds ? meta.scaffolds.longstitch ?: null : null,       'scaffold/longstitch' ],
                [ meta.id, meta.scaffolds ? meta.scaffolds.links ?: null : null,            'scaffold/links'      ],
                [ meta.id, meta.polished ? meta.polished.pilon ?: null : null,            'polish/pilon'        ],
                [ meta.id, meta.polished ? meta.polished.medaka ?: null : null,           'polish/medaka'       ],
                [ meta.id, meta.polished ? meta.polished.dorado ?: null : null,           'polish/dorado'       ],
                [ meta.id, meta.assembly, {
                    // Assembly publishdirs are a bit more specific
                    meta.strategy == "single" ? (
                        meta.assembler_ont == "flye" || meta.assembler_hifi == "flye"
                            ? 'assembly/flye'
                            : 'assembly/hifiasm'
                    ) :
                    meta.strategy == "hybrid"
                        ? 'assembly/hifiasm'
                        : 'assembly/ragtag'
                    }
                ]
                ]
        }
my issue here, is that I have multiple files from a single channel, that i need to make long, and then find the correct file
after the above comes this:
Copy code
.filter {
            _id, file, _subdir -> file != null
        }
        .map {
            id, assembly_file, subdir ->
                [
                    file(assembly_file).name.baseName(),
                    {"${outdir_uri}/${id}/${subdir}/${file(assembly_file).name}"}
                ]
        }
Probably my main issue that I am (still) getting confused by channels, lists and how to convert a "wide" (list) channel into a "long" channel that contains the list entries
d
Personally, I think it's better that the downstream pipeline chases the upstream rather than the other way around so I'm not adding any samplesheet/param file generation to "my" pipelines. Moreover, nf-meta looks like a better way. Haven't tested that yet.
n
Hm, interesting perspective. Probably depends a bit on how obvious the link between the two pipelines is
p
I wish the index system was more flexible, at the moment it is not great
Hop onto
#nextflow-syntax
on the Nextflow slack with any suggestions!
We're hoping to stop making changes to the syntax for a while after this release, so get your ideas in quickly otherwise it might be a while before it happens 😅
j
I have proposed my request already! github.com/nextflow-io/nextflow/issues/6830
👀 1
It would be a simple but powerful addition to be able to write an index per channel entry (e.g. per sample, capturing output paths)
We're hoping to stop making changes to the syntax for a while after this release, so get your ideas in quickly otherwise it might be a while before it happens
we do need to catch up 🙏🙏🙏
👍🏻 1