You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
First of all, I would like to thank you for this wonderful and very powerful package!
I have tried to plot a phylogenetic tree with heatmap of associated matrix (with gheatmap).
I found that the row names of matrix doesn't exactly match to the tip names of tree in case if there is missing data in associated matrix.
In other words, if we have two species (e.g., Species198 and Species1981), but only one of them is represented in the associated matrix, we will have colored cells for both species in the heatmap.
Here is a reproducible example:
library(ggtree)
set.seed(111)
# Prepare a species list
tipss <- c("Fomes", "Rozella", "Saitoella", "Entorrhiza", "Cryptococcus", "Tremella", "Puccinia", "Amoeboaphelidium")
tipss <- c(tipss, "Species198", "Species1981")
# Generate random tree
trr <- ape::rtree(n = length(tipss), rooted = TRUE, tip.label = tipss)
# Generate associated data matrix for each species
abunds <- matrix(data = sample(1:100, size = 4*length(tipss)), nrow = length(tipss))
rownames(abunds) <- tipss
colnames(abunds) <- paste("Samp", 1:ncol(abunds), sep="")
# Remove data for some species
abunds <- abunds[-which(rownames(abunds) == "Species198"), ] # !! no information for this species
abunds <- abunds[-which(rownames(abunds) == "Cryptococcus"), ]
tt <- ggtree(trr) + geom_tiplab()
gheatmap(tt, abunds)
Here is the resulting picture:
You may see that heatmap cells are blank for Cryptococcus (as expected).
However, cells corresponding to Species198 are colored with Species1981 data (marked with red arrow).
With best regards,
Vladimir
The text was updated successfully, but these errors were encountered:
Prerequisites
Describe you issue
Ask in right place
Hello!
First of all, I would like to thank you for this wonderful and very powerful package!
I have tried to plot a phylogenetic tree with heatmap of associated matrix (with
gheatmap
).I found that the row names of matrix doesn't exactly match to the tip names of tree in case if there is missing data in associated matrix.
In other words, if we have two species (e.g., Species198 and Species1981), but only one of them is represented in the associated matrix, we will have colored cells for both species in the heatmap.
Here is a reproducible example:
Here is the resulting picture:
You may see that heatmap cells are blank for Cryptococcus (as expected).
However, cells corresponding to Species198 are colored with Species1981 data (marked with red arrow).
With best regards,
Vladimir
The text was updated successfully, but these errors were encountered: