Open nutrimol opened 4 months ago
Dear user,
Thank you for your report and for trying out the MicrobiomeStat package. I apologize for the inconvenience caused by the error you encountered.
It looks like the error occurred because the midpoint
function from the phangorn
package could not be found when trying to root the phylogenetic tree. The mStat_convert_phyloseq_to_data_obj
function expects a rooted tree.
If your phyloseq object ps
already contains a phylogenetic tree (phy_tree
), please make sure to load the phangorn
package before running the conversion:
library(phangorn)
data.obj <- mStat_convert_phyloseq_to_data_obj(ps)
Loading phangorn
will make the midpoint
function available for rooting the tree during the conversion process. I apologize for not making this clear in the package documentation. I will update the wiki to mention this dependency when a tree is present.
Please let me know if loading phangorn
resolves the issue for you. If you encounter any further problems, feel free to open a new issue on the GitHub repository.
Thank you for your patience and for bringing this to my attention. I appreciate your interest in using MicrobiomeStat.
Best regards, Chen YANG
Dear Chen, Thank you for your prompt response! I loaded phangorn and it worked smoothly. Thank you and congratulations for developing such a useful tool Best regards, Virginia
Dear developer,
Congratulations for this great tool. I have a problem while trying to convert my phyloseq object to microbiomeStat object. It seems it does not found midpoint function.
I installed all the dependencies following the installation guide. Then, I execute the code below. Do you have any clue of what is going on here?
Thank you for your time!
library(MicrobiomeStat) library(tidyverse) library(phyloseq)
Required package
library(microbiome) library(ape)
setwd("/Users/virginia/Dropbox/rrr/emu_phyloseq/") # mac
################################################################################
load Phyloseq object
################################################################################ ps <- readRDS(file= "./phylo_obj/ps.rds")
Check if taxa are rows in the Phyloseq object
phyloseq::taxa_are_rows(ps) str(ps)
Convert the Phyloseq object to a MicrobiomeStat data object
data.obj <- mStat_convert_phyloseq_to_data_obj(ps)
output:
``