-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to unify the list generated after classification? #68
Comments
Thanks @lauraDRH for opening this issue! Currently this needs some downstream processing:
Is this the format you were looking for? |
Hi!
Before running it I already removed duplicates from my ids vector, which looks like this
So I really do not understand that error... because there are supposed to be no duplicates |
Oh I see why this happens, e.g. here: taxizedb::classification(270636)
#> $`270636`
#> name rank id
#> 1 cellular organisms no rank 131567
#> 2 Bacteria superkingdom 2
#> 3 Terrabacteria group clade 1783272
#> 4 Cyanobacteria/Melainabacteria group clade 1798711
#> 5 Cyanobacteria phylum 1117
#> 6 Spirulinales order 1890443
#> 7 Spirulinaceae family 1890448
#> 8 Spirulina genus 1154
#> 9 Spirulina major species 270636
#>
#> attr(,"class")
#> [1] "classification"
#> attr(,"db")
#> [1] "ncbi" Created on 2023-07-07 with reprex v2.0.2 The term
And then convert to wide format. Fingers crossed, let me know if this solves the issue! |
omg thank you so much! I totally missed that clade duplicate thanks for your time and developing this package, works perfectly :) |
Instead of filtering taxon ranks you can also define a function that will collapse conflicting entries into a single entry:
For |
I think a utility function which converts the list output to wide format like we discussed here might be useful so I'll keep this issue open for now. |
Yes, I think it would be super useful, as in the end probably a lot of users need it |
Hi! Just wanted to say thanks, this fixed my issue today. I used the non-filtering option and it worked well. |
Hi!
I am struggling to put together the output of classification().
I have a list of IDs (ids) that I wanted to get the different taxonomic levels from, so I ran the code:
This worked completely fine, but it generated a list of data frames. One dataframe per ID.
I would like to put together all the dataframes, and obtain a table that has these columns: ID, phylum, order, class, family and genus but I do not know how to merge them.
Thanks for the suggestions!
The text was updated successfully, but these errors were encountered: