joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
569 stars 187 forks source link

tax_table function stopped working properly #1615

Open valentinavan opened 1 year ago

valentinavan commented 1 year ago

Hi,

I have been using the same script many times with the same data and never had any problems, but lately it seems like tax_table function is not working anymore for me.

I keep having error messages like:

table(tax_table(phylo_object)[, "phylum"], exclude = NULL)
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘tax_table’ for signature ‘"phyloseq"’

or

tax_mat<- as.matrix(taxa)
phylo_TAX<- tax_table(tax_mat)
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘tax_table’ for signature ‘"matrix"’

The only thing I can think of is that i have recently updated R and R studio.

Thanks

For context:

phylo_object
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 49917 taxa and 20 samples ]
sample_data() Sample Data:       [ 20 samples by 6 sample variables ]
tax_table()   Taxonomy Table:    [ 49917 taxa by 7 taxonomic ranks ]

str(taxa)
'data.frame':   49917 obs. of  7 variables:
 $ superkingdom: chr  "Bacteria" "Bacteria" "Bacteria" "Bacteria" ...
 $ phylum      : chr  "Actinobacteria" "Actinobacteria" "Actinobacteria" "Acidobacteria" ...
 $ class       : chr  "Rubrobacteria" "Actinomycetia" "Actinomycetia" NA ...
 $ order       : chr  "Rubrobacterales" "Pseudonocardiales" NA NA ...
 $ family      : chr  "Rubrobacteraceae" NA NA NA ...
 $ genus       : chr  NA NA NA NA ...
 $ species     : chr  "uncultured Rubrobacteraceae bacterium" "Pseudonocardiales bacterium" "Actinomycetia bacterium" "Acidobacteria bacterium" ...
ycl6 commented 1 year ago

Hi @valentinavan

Can you provide your sessionInfo()? Also what did you see when you type ?tax_table to read the R documentation?

npj06 commented 3 weeks ago
截屏2024-06-26 09 38 35

sessionInfo() R version 4.3.3 (2024-02-29) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Sonoma 14.5

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Asia/Shanghai tzcode source: internal

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] microbiome_1.24.0 Maaslin2_1.16.0 vegan_2.6-6.1
[4] lattice_0.22-6 permute_0.9-7 ggpubr_0.6.0
[7] lubridate_1.9.3 forcats_1.0.0 stringr_1.5.1
[10] dplyr_1.1.4 purrr_1.0.2 readr_2.1.5
[13] tidyr_1.3.1 tibble_3.2.1 ggplot2_3.5.1
[16] tidyverse_2.0.0 remotes_2.5.0 MicrobiotaProcess_1.14.1 [19] phyloseq_1.48.0

loaded via a namespace (and not attached): [1] libcoin_1.0-10 RColorBrewer_1.1-3
[3] rstudioapi_0.16.0 jsonlite_1.8.8
[5] magrittr_2.0.3 TH.data_1.1-2
[7] modeltools_0.2-23 ggbeeswarm_0.7.2
[9] fs_1.6.4 zlibbioc_1.48.2
[11] vctrs_0.6.5 multtest_2.58.0
[13] memoise_2.0.1 RCurl_1.98-1.14
[15] ggtree_3.10.1 rstatix_0.7.2
[17] usethis_2.2.3 htmltools_0.5.8.1
[19] S4Arrays_1.2.1 broom_1.0.6
[21] Rhdf5lib_1.24.2 SparseArray_1.2.4
[23] rhdf5_2.46.1 gridGraphics_0.5-1
[25] htmlwidgets_1.6.4 plyr_1.8.9
[27] sandwich_3.1-0 zoo_1.8-12
[29] cachem_1.1.0 igraph_2.0.3
[31] mime_0.12 lifecycle_1.0.4
[33] iterators_1.0.14 pkgconfig_2.0.3
[35] Matrix_1.6-5 R6_2.5.1
[37] fastmap_1.2.0 GenomeInfoDbData_1.2.11
[39] MatrixGenerics_1.14.0 shiny_1.8.1.1
[41] digest_0.6.36 aplot_0.2.3
[43] colorspace_2.1-0 ggnewscale_0.4.10
[45] patchwork_1.2.0 S4Vectors_0.40.2
[47] microeco_1.7.1 pkgload_1.3.4
[49] GenomicRanges_1.54.1 timechange_0.3.0
[51] fansi_1.0.6 abind_1.4-5
[53] mgcv_1.9-1 compiler_4.3.3
[55] withr_3.0.0 backports_1.5.0
[57] DBI_1.2.3 carData_3.0-5
[59] biglm_0.9-3 pkgbuild_1.4.4
[61] ggsignif_0.6.4 MASS_7.3-60.0.1
[63] sessioninfo_1.2.2 DelayedArray_0.28.0
[65] biomformat_1.30.0 optparse_1.7.5
[67] tools_4.3.3 vipor_0.4.7
[69] beeswarm_0.4.0 ape_5.8
[71] httpuv_1.6.15 glue_1.7.0
[73] nlme_3.1-165 rhdf5filters_1.14.1
[75] promises_1.3.0 grid_4.3.3
[77] Rtsne_0.17 cluster_2.1.6
[79] reshape2_1.4.4 ade4_1.7-22
[81] generics_0.1.3 gtable_0.3.5
[83] tzdb_0.4.0 hms_1.1.3
[85] data.table_1.15.4 car_3.1-2
[87] coin_1.4-3 utf8_1.2.4
[89] XVector_0.42.0 BiocGenerics_0.48.1
[91] ggrepel_0.9.5 foreach_1.5.2
[93] pillar_1.9.0 yulab.utils_0.1.4
[95] later_1.3.2 robustbase_0.99-2
[97] splines_4.3.3 getopt_1.20.4
[99] treeio_1.26.0 survival_3.7-0
[101] tidyselect_1.2.1 Biostrings_2.70.3
[103] miniUI_0.1.1.1 gridExtra_2.3
[105] IRanges_2.36.0 SummarizedExperiment_1.32.0 [107] ggtreeExtra_1.12.0 stats4_4.3.3
[109] Biobase_2.62.0 devtools_2.4.5
[111] matrixStats_1.3.0 DEoptimR_1.1-3
[113] stringi_1.8.4 lazyeval_0.2.2
[115] ggfun_0.1.5 codetools_0.2-20
[117] ggplotify_0.1.2 cli_3.6.3
[119] xtable_1.8-4 munsell_0.5.1
[121] Rcpp_1.0.12 GenomeInfoDb_1.38.8
[123] parallel_4.3.3 ellipsis_0.3.2
[125] profvis_0.3.8 urlchecker_1.0.1
[127] bitops_1.0-7 ggstar_1.0.4
[129] mvtnorm_1.2-5 tidytree_0.4.6
[131] scales_1.3.0 pcaPP_2.0-4
[133] crayon_1.5.3 rlang_1.1.4
[135] multcomp_1.4-25

Hello, I encountered the same issue as her, how can I resolve it?

npj06 commented 3 weeks ago

Hi @valentinavan

Can you provide your sessionInfo()? Also what did you see when you type ?tax_table to read the R documentation?

Hello, I encountered the same issue as her, how can I resolve it? Thanks for your help