Hi ! I would like to update all the bcftools and s...
# modules
l
Hi ! I would like to update all the bcftools and samtools modules. There is some discrepancies in the index optional emission. Here is what I would do for the index emission
Copy code
tuple val(meta), path("*.{csi,tbi}") , emit: index, optional: true
I would also use as a tuple the fasta with its index in input:
Copy code
tuple val(meta2), path(fasta), path(fai)
I would also add the missing input files in some of the modules: rename_chr in bcftools annotate, bai in samtools depth, ... Should I create a PR for all modules together or separately ?
<!subteam^S016E36N7TQ> Should I go for that ?
r
we have the fai index always as second channel. What is the reason for changing it here? The index part looks good. <!subteam^S044DU0NG68>
l
It is just in the case where you need to perform parallelization across multiple fasta. If you do so with the fai separated from the fasta you might encounter a time where the index does not correspond to the fasta ?
m
I kind of disagree with the index part. I’d rather see separate (optional) channels for both types so I know exactly what I’m getting
r
ah good point and yes agreed
m
Better to be explicit about such things
l
@Matthias De Smet Why would a tuple not give you the same level of information than two separate channels ? Would there be a possibility to still give synchronously both the fasta and the fai ? 🤔
m
I’m talking about the
{tbi,csi}
output 😉
I personally have no qualms with the
fasta,fai
r
yep makes sense. Just wanted to know why because it differs from other tools. Wouldn't
multiMap
solve this issue?
this 1
l
Ah okay ! The reasoning behind merging
{tbi,csi}
was that when joining afterwards the file with its index it would be easier and also if the user change from csi to tbi it would still give the good file with its index.
m
> Wouldn’t
multiMap
solve this issue? Contrary to popular beliefs, it doesn’t. You can still get mixed up channels
😱 1
l
I never used
multiMap
how would you use it to join independently if a csi or tbi is produced with separate channels ?
Copy code
BCFTOOLS_VIEW(my_input)
BCFTOOLS_VIEW.out.vcf
    .join(BCFTOOLS_VIEW.out.tbi
        .mix(BCFTOOLS_VIEW.out.csi)
    )
l
Thanks @Matthias De Smet ! It's a bit more complexe, but it should work.
r
ok, I have not trusted it so far 😄 sure in that case fasta and fai together make sense
m
ok, I have not trusted it so far 😄 sure in that case fasta and fai together make sense
The only way to truly avoid mixing up channels is by having everything in one tuple, which means modifying all the nf-core modules that use reference data
homer disappear 1
We’ve had to do so in https://github.com/nf-cmgg/preprocessing to be able to support multiple references in one run
l
That could be an issue for the #hackathon-oct-2024
j
Contrary to popular beliefs, it doesn’t. You can still get mixed up channels (edited)
WHAT?!
Please expand
n
https://github.com/nf-core/modules/blob/master/subworkflows/nf-core/bam_sort_stats_samtools/main.nf#L24-L35
Doesn't this create bottlenecks? I personally prefer to have
csi
and
tbi
in the same channel for the ease of use (but not a #hill-to-die-on )
m
@James Fellows Yates, we’ve already had this conversation in the past 😉 combining queue channels, even with multimap, does not give reproducible results 100% of the time
@Nicolas Vannieuwkerke, not sure about the bottleneck, but having explicit output channels guarantees that you’re getting the desired output. Ambiguous output channels can “hide” configuration mistakes
j
I think I was on parental leave at that point, so probably not there anymore 😅
n
In my head using
remainder
means that there is a posibility of bottlenecks. In this case, if only
bai
is created for example, the process will not find any
csi
files thus preventing
SAMTOOLS_INDEX
to have those as output. This will make the pipeline wait until all `SAMTOOLS_INDEX`processes have been run before resolving the last
.join
This would be solved by either having both indices in the same output or if you
.mix
the index channels before the
.join
and join without
remainder
j
Back on topic: I agree with merging the two, csi/bai or w/e serve the same purpose
this 2
m
Disagree, I’ve come across an issue with this in the past where I didn’t get the desired output due to a config issue, but the problem was obfuscated because of an ambiguous output channel
a
Oh no, tuples vs multiMap. Is it Tuesday again?
🤣 3
m
There’s a new thread on this, let’s follow up there
n
I don't mind either I simply mix both
index
output channels if they are separated anyways 😛
l
I might have open something that I shouldn't had 😅
🤣 1
💥 1
m
can of worms
i
I feel like this topic returns every time someone updates a module
💯 2
a
I believe there is a plan afoot to decide on The One True Way™️ to do this in Nextflow which will make this simpler even if it upsets some people.
j
But how soon?
(and upset how 👀 )
n
Now I'm curious eyebrows
m
I think I remember reading something somewhere about named inputs in DSL2.5
☝️ 1
@Ben Sherman will know the fine points
j
Ah yes, but why would that upset people
🤔
m
because we then would have about 2K modules that need to be updated and tested 🤷🏻
j
Oh that's fine though
😆
No one can escape 😬
m
the greater good
😆 2
g
> because we then would have about 2K modules that need to be updated and tested 🤷🏻 Maybe a job for AI? (I'm only slightly kidding)
💯 1
m
I don't trust anyone here but @Simon Pearce to look at modules
homer disappear 2
😆 1
s
image.png
b
multiMap is fine joining into one long tuple is also fine I will (hopefully) provide something better than both in the future sorry for creating so much confusion over multiMap
🎉 5