Open bluenote-1577 opened 10 months ago
Hi Jim, Here is a suggestion: Save read length while sketching so the user does not have to provide it to compute true coverage.
Is there/could there be a method to output unassigned reads into a file as an output?
Hi @astrovsky01,
This is unfortunately not possible due to the way sylph works. It doesn't classify each read. It operates on the ensemble of reads. This means it can not output unassigned reads, only estimate the percentage of.
@bluenote-1577 I'm not sure how the backend algorithm works but is it possible to add Align_fraction_ref
to Sylph
output similar to Skani
? Would be useful to know how much of the genomes being profiled are covered.
@jolespin Hi Josh, unfortunately this isn't possible. This is because skani actually tries to get a pseudo-ish alignment, by sylph doesn't do anything like that. I agree it would be very nice if it were possible though...
Ok that's good to know! Would finding the overlap in kmers do the trick or is it way more complicated than that?
Also one more question, does sylph allow for outputting abundance instead of relative abundance?
@jolespin sorry for the late response:
1) There may be something that could be done for pseudo-alignment overlapping k-mers ... but it's a very nontrivial algorithmic thing :)
2) What do you mean by abundance instead of relative abundance? Sylph outputs coverage (Est_cov) if that's what could be helpful
There may be something that could be done for pseudo-alignment overlapping k-mers ... but it's a very nontrivial algorithmic thing :)
I can imagine that is quite complicated. Themisto just popped up on my radar so I'm going to give this a try soon.
What do you mean by abundance instead of relative abundance? Sylph outputs coverage (Est_cov) if that's what could be helpful
Is the Est_cov
what you use before normalizing the Taxonomic abundance
?
Taxonomic_abundance: normalized taxonomic abundance as a percentage. Coverage-normalized - same as MetaPhlAn abundance https://github.com/bluenote-1577/sylph/wiki/Output-format
I'm mostly curious on how some of my compositionally valid network analysis (https://github.com/jolespin/ensemble_networkx) differs between coverage normalized and unnormalized data but definitely not a critical assessment. Just a bit of curiosity.
This is unfortunately not possible due to the way sylph works. It doesn't classify each read. It operates on the ensemble of reads. This means it can not output unassigned reads, only estimate the percentage of.
I'm looking at the docs now and not sure which field indicates the % of reads/k-mers not aligned/overlapping(sorry if that's the wrong term) with the k-mers in the database/sketch. If this isn't currently available, would it be possible to add this metric? It would greatly benefit my workflow when determining whether or not I want to assemble/bin genomes from a metagenomic assembly.
@jolespin
You'll notice that the "Sequence abundance" column doesn't sum to 100% if the -u
option is specified (unless sylph determines that 100% of your reads are classified at species level). Ths sum of this column indicates the % of reads classified at species level. That is, the sequence abundance is scaled by the % of classified reads. So
So without -u
, you'll get
Species 1 50% Species 2 50%
But with -u
, if 10% of the reads come from species-level detected genomes, you'll get
Species 1 5% Species 2 5%
let me know if that makes sense. I didn't want to add a new column because it doesn't really make sense... but this is a bit non-obvious to see
Excellent! Love that functionality. So essentially, I can just run -u
and then w/ Pandas do something like X["unclassified"] = 100 - X.sum(axis=1)
if I want the % of unclassified reads in the table. Alternatively, I can do (X/X.sum(axis=1).values.reshape(-1,1)) * 100
before I add the unclassified column to get the relative abundance of the taxa.
@jolespin yes exactly. BTW, I discovered the "discussion" feature in github. I think we can migrate the questions there, as well as suggestions, perhaps keeping this thread for specific feature requests.
Feature requests
Purpose: this is a place to easily log suggestions/feature requests. E.g:
Give a rationale and provide concise/clear instructions if possible. Opinions are welcome too.
You're welcome to email me or open another issue. This thread is to aggregate suggestions without the hassle of opening another issue.
Current feature requests
Here are some current feature requests.
Originally posted by @jolespin in https://github.com/bluenote-1577/skani/issues/23#issuecomment-1858723727
Option for renaming samples. Sylph currently fixes each sample sketch to the read names. `done in v0.5.0Line-delimited file for database sketches fordone in v0.5.0sylph profile/query
@fplaza https://github.com/bluenote-1577/sylph/issues/6#issuecomment-1859073351
Save read length while sketching so the user does not have to provide it to compute true coverage.done in v0.5.0https://github.com/bluenote-1577/sylph/issues/7