Hello everyone, Question while adding sourmash to ...
# createtaxdb
h
Hello everyone, Question while adding sourmash to taxprofiler. The
nf-core/modules/sourmash/sketch
module hardcodes
--merge
, so in createtaxdb all reference genomes get merged into ONE signature per DB (confirmed with
sourmash sig describe
). Sourmash GATHER would return only 1 match, since db has only one merge signature. and then tax annotate cant map it to species... We probably need per-genome signatures (via
--singleton.
(Note: i tried to use createtaxdb, so can generate some test files for taxprofiler). Any thoughts?
j
Good question, @moritz implemented the module and also in the pipeline...
It does sound similar to an issue I had with KMCP a few months ago... The single dB /Sig etc , was because it was designed for pathogens but often the docs were unclear on this...
It could maybe be
--merge
was used to make it easier to
emit
(but not being aware of the un intended side effect)
m
Huh, are you sure? I have used this and definitely had more than one taxon hit.
🤔 1
j
Could it be something to do with taxonomy files?
m
If you have multiple files, sourmash will by default create one sketch for each file. For situations such as paired-end read files from Illumina sequencing, you may instead want to build a combined sketch.
You can build a combined sketch in two ways.
First, you can use --name/--merge to build a single (named) sketch out of multiple input
Sorry, it's been some time @Haris Spyridis, you are right. But the intention was always to only merge pairs.
h
that what i get,in when i sourmash describe
m
Okay, but you also only have one library file it looks like.
h
no problem, i was trying to figure out whats going on, i was trying to understand if it indeed 1 signature
yeah, i think the only thing is to use
--singleton
instead of
--merge
inside the pipeline
j
It sounds like then the
--merge
needs to be moved to some
ext.args
type thing then, if it is optional/more for pair-end sequences
@Haris Spyridis I forget if you volunteered to update the module, otherwise I could do it one weekend
Do i understand correctly?
OK more info:
Copy code
Input contents and output signatures

By default, sourmash sketch will produce signatures for each input file. If the file contains multiple FASTA/FASTQ records, these records will be merged into the output signature. You can provide a list of FASTA files in a text file to sourmash sketch by passing the text file path in via --from-file.

If you specify --singleton, sourmash sketch will produce signatures for each record.

If you specify --merge <name>, sourmash sketch will produce signatures for all input files and combine them into one signature.

The output signature(s) will be saved in locations that depend on your input parameters. By default, sourmash sketch will put the signatures in the current directory, in a file named for the input file with a .sig suffix. If you specify -o, all of the signatures will be placed in that file.
So indeed
--merge
is wrong... I guess at a genome level this is more like making a sketch for a genome from one organism with multiple comoromsommes...
m
What language autocorrect is that? 😃
😅 1
j
Sleep deprived James 😆
😂 1
jesus
thats a bad one😆
chromosomes*
Here we go @Haris Spyridis @moritz https://github.com/nf-core/modules/pull/12999 Annoyingly took a lot longer than I wanted because tests 😬 ...
h
ahah you got me, i was about to push my PR
j
AHH shit sorrt
h
no problem,it is the same same, it wasn much work
So as i have it my \mind and If I understand correctly: • Taxprofiler should use
merge_sigs = true
when sketching reads (combines paired-end R1+R2 into one query signature per sample). • Createtaxdb should use
merge_sigs = false
(default behavior) so each genome file produces its own signature, enabling species-level taxonomic profiling downstream.
j
That is my understanding yes
h
great, !! same understanding 🙂
m
I didn't fully get your comment, James, why is prefix inaccessible to config?
h
i think because config evaluated before process run i am right? and prefix is defined at script level.... in my potential PR i had with a flag like def
merge_flag = task.ext.merge != null ? task.ext.merge : "--merge '${prefix}'"
this 1
Users would just set
ext.merge = "--singleton"
in config as a simple string. Jame's boolean approach is cleaner though
m
No, the default for the prefix is a closure, evaluated in process from the meta map input.
👍 1
h
ah right
j
At least I have never been able to access prefix from modules.conf from what I remember . The default itself happens within the process not modules.conf
E.g. you can set a new prefix in the config: https://github.com/nf-core/createtaxdb/blob/main/conf%2Fmodules.config#L106-L109 But I don't think the default t gets pulled back into modules.xonf (at least I'm pretty sure)
@Haris Spyridis @moritz https://github.com/nf-core/createtaxdb/pull/212/changes Finally got around ot updating the modules in the pipeline, hopefully in time to do a synced release with @Sofia Stamouli’s upcoming taxprofiler release!
🙌 2
✅ 1
h
great ! i am also finalizing your code review for the sourmash-PR~!
❤️ 2