What is `prefixes` in ```process KRAKENUNIQ_PRELOA...
# taxprofiler
m
What is
prefixes
in
Copy code
process KRAKENUNIQ_PRELOADEDKRAKENUNIQ {

    input:
    // We stage sequencing files in a sub-directory so we don't accidentally gzip them later.
    tuple val(meta), path(sequences, name: 'sequences/*'), val(prefixes)
    val sequence_type
    path db
    val save_output_reads
    val report_file
    val save_output
and why is it required? I'm using this module in another workflow and did an update, but I don't understand what
prefixes
is for.
meta.yml
is not illuminating me and I don't see what this might be referring to in the tool docs.
Oh this is
ext.prefix
. What? Why does this module differ like this?
l
I never used the krakenuniq, but here is the meta info
j
Basically because we want to use the weird 'preloaded' mode to be more memory efficient (KrakenUniq databases are massive), we have to bundle samples together into batches - meaning we lose the ability to have 'true' nf-core prefixes via meta. But to ensure the output files have unique names, we found we had to pre-define the file names of the outpout files - and in particular add
.se
and
.pe
for when you have both types of data. @moritz would be best to explain as he implemented it. It is indeed a bit messy, but this type of 'load database into memory with a separate command' was really awkward.
m
I can understand that, but it feels like it's skirting guidelines where users should be able to control prefix, or at least that's what I understood that to be.
m
If we can make the description better, just let us know what needs to be clearer.
m
I think just reference it replaces
ext.prefix
and if developers want users to be able to change it, they need to provide a parameter
👍 1
So, just so I understand what was inadequate about
ext.prefix
that it couldn't be used here? Why not have something like
Copy code
ext.prefix = { [ "\$( basename \${SEQ%.gz} .fastq )", meta.single_end? ".se": ".pe" ].join("") }
j
I think because it's a list of files going in... not a single one... so there was no proper per-sample prefix, so the prefix had to be inferred with bash
(at lesat partly)
m
Note that input can be FASTA or FASTQ, but that looks like something similar might work. It's pretty obscure, I'd argue, so is it better than expecting a list as input?
this 1
m
It depends what you want to enforce I guess. Conformity with the rest of nf-core modules ( i.e. the pipeline user should be able to change the prefix of any process output using the config ), or updating the module to make it easier to input something for the developer. I can't argue with the obscurity angle, but then maybe we need better documentation of patterns if people are having a hard time finding this as a solution. What bothers me is that there is a change in interface, and to me there shouldn't be multiple ways to interact with certain aspects of modules particularly if it affects the user.
m
I honestly don't have time and energy, but will not stand in your way.
j
I mentioned trauma didn't I @Mahesh Binzer-Panchal 😅 If you can find a better system I think it would be more than welcome