Skip to content
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

Informative taxa labels for plots, even when some ranks are NA #1039

Open
RJ333 opened this issue Nov 22, 2018 · 1 comment
Open

Informative taxa labels for plots, even when some ranks are NA #1039

RJ333 opened this issue Nov 22, 2018 · 1 comment
Assignees

Comments

@RJ333
Copy link

RJ333 commented Nov 22, 2018

Hello everyone,

I was wondering if there is a way to use rank_names after the glomming of a phy_tree object in phyloseq. I assume that glomming on phylogeny using tip_glom would be the harder case, but if you consider this tax_glom example:

# agglomerate by rank (taxonomy)
ps_genus <- tax_glom(ps, "Genus", NArm = TRUE)

# after glomming, only taxa_names -> Otu000... can be used as label, not genus or other ranks

# this is fine
plot_tree(ps_genus, "treeonly", label.tips = "taxa_names", text.size = 3)

# this not
plot_tree(ps_genus, "treeonly", label.tips = "Genus", text.size = 3)
plot_tree(ps_genus, "treeonly", label.tips = "Class", text.size = 3)
Don't know how to automatically pick scale for object of type taxonomyTable. Defaulting to continuous.
Error in as(x, "matrix")[i, j, drop = FALSE] :
  incorrect number of dimensions

# check entries of ps-object and of taxonomy table
ps_genus
tax_table(ps_genus)

So the number of entries for taxonomy and tree tips correspond, but (in my data) "Genus" contains multiple NAs. I also tested with "Class", which contains no NAs, but duplicated entries.

Is there a way around to display a taxonomic rank of the leaves after using a *_glom function?

Thanks!

@joey711
Copy link
Owner

joey711 commented Feb 17, 2019

The way I have been accomplishing this in my own work is a custom function that adds a taxonomic pseudo-rank called something like "lowestTaxonomy". Often in summary graphics this is the label that you want, as the classification precision for different sequences can vary widely across different ranks, but you'd still like to know, for example, what the Family classification was, even if Genus and Species are missing.

I'll think about how to support something like this in the future, and leave this open for now...

@joey711 joey711 changed the title using rank_names for label.tips after tax_glom or tip_glom? Informative taxa labels for plots, even when some ranks are NA Feb 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants