Hi,
I'm trying to use a variance stabilizing transformation with varianceStabilizingTransformation function including in DESeq (I'm using the 1.26.0 version) to get the Euclidean distances and plot a hierarchical clustering of my localities. But, when I used this function I get the following error message:
Error in taxaarerows(x) : trying to get slot "taxaarerows" from an object (class "otu_table") that is not an S4 object
Above, I'll write step by step scripting. I can't understand why I get this error, I was reading about that and I can't similar errors from this function or DESeq function.
Thanks in advance.
To import my biom file, i used:
biom.full <- import_biom(BIOMfilename = "myFile.biom") ## phyloseq 1.30.0
str(biom.full)
Formal class 'phyloseq' [package "phyloseq"] with 5 slots
..@ otu_table:Formal class 'otu_table' [package "phyloseq"] with 2 slots
.. .. ..@ .Data : num [1:9182, 1:203] 10 0 0 6 0 61 41 0 138 65 ...
.. .. .. ..- attr(*, "dimnames")=List of 2
.. .. .. .. ..$ : chr [1:9182] "4479946" "4479944" "1050608" "973124" ...
.. .. .. .. ..$ : chr [1:203] "154" "160" "155" "19" ...
.. .. ..@ taxa_are_rows: logi TRUE
..@ tax_table:Formal class 'taxonomyTable' [package "phyloseq"] with 1 slot
.. .. ..@ .Data: chr [1:9182, 1:7] "k__Bacteria" "k__Bacteria" "k__Bacteria" "k__Bacteria" ...
.. .. .. ..- attr(*, "dimnames")=List of 2
.. .. .. .. ..$ : chr [1:9182] "4479946" "4479944" "1050608" "973124" ...
.. .. .. .. ..$ : chr [1:7] "Rank1" "Rank2" "Rank3" "Rank4" ...
..@ sam_data : NULL
..@ phy_tree : NULL
..@ refseq : NULL
counttab <- otutable(biom.full, errorIfNULL = T)
deseqcounts <- DESeqDataSetFromMatrix(counttab, colData = datos2, design = ~LOCATION)
str(deseq_counts)
deseq_counts
class: DESeqDataSet
dim: 9182 203
metadata(1): version
assays(1): counts
rownames(9182): 4479946 4479944 ... New.CleanUp.ReferenceOTU34278 New.CleanUp.ReferenceOTU34449
rowData names(0):
colnames(203): 154 160 ... 101 65
colData names(12): COD N_COD ... ID.QIIME IDtmp
sizeFdeseq <- estimateSizeFactors(deseqcounts, type = "poscounts")
VSTdeseq <- varianceStabilizingTransformation(sizeFdeseq)
Error in taxa_are_rows(x) :
trying to get slot "taxa_are_rows" from an object (class "otu_table") that is not an S4 object
#
MY SESSION INFO:
sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] plotly_4.9.2.1 ggplot2_3.3.2 DESeq2_1.26.0 SummarizedExperiment_1.16.1
[5] DelayedArray_0.12.3 BiocParallel_1.20.1 matrixStats_0.56.0 Biobase_2.46.0
[9] GenomicRanges_1.38.0 GenomeInfoDb_1.22.1 IRanges_2.20.2 S4Vectors_0.24.4
[13] BiocGenerics_0.32.0 phyloseq_1.30.0 xlsx_0.6.3
loaded via a namespace (and not attached):
[1] nlme_3.1-148 bitops_1.0-6 bit64_0.9-7 httr_1.4.1 RColorBrewer_1.1-2
[6] tools_3.6.3 backports_1.1.8 R6_2.4.1 vegan_2.5-6 rpart_4.1-15
[11] lazyeval_0.2.2 Hmisc_4.4-0 DBI_1.1.0 mgcv_1.8-31 colorspace_1.4-1
[16] permute_0.9-5 ade4_1.7-15 nnet_7.3-14 withr_2.2.0 tidyselect_1.1.0
[21] gridExtra_2.3 bit_1.1-15.2 compiler_3.6.3 htmlTable_2.0.0 scales_1.1.1
[26] checkmate_2.0.0 genefilter_1.68.0 stringr_1.4.0 digest_0.6.25 foreign_0.8-76
[31] XVector_0.26.0 base64enc_0.1-3 jpeg_0.1-8.1 pkgconfig_2.0.3 htmltools_0.5.0
[36] htmlwidgets_1.5.1 rlang_0.4.6 rstudioapi_0.11 RSQLite_2.2.0 generics_0.0.2
[41] jsonlite_1.7.0 acepack_1.4.1 dplyr_1.0.0 rlist_0.4.6.1 RCurl_1.98-1.2
[46] magrittr_1.5 GenomeInfoDbData_1.2.2 Formula_1.2-3 biomformat_1.14.0 Matrix_1.2-18
[51] Rcpp_1.0.4.6 munsell_0.5.0 Rhdf5lib_1.8.0 ape_5.4 lifecycle_0.2.0
[56] stringi_1.4.6 MASS_7.3-51.6 zlibbioc_1.32.0 rhdf5_2.30.1 plyr_1.8.6
[61] blob_1.2.1 grid_3.6.3 crayon_1.3.4 lattice_0.20-41 Biostrings_2.54.0
[66] splines_3.6.3 multtest_2.42.0 annotate_1.64.0 xlsxjars_0.6.1 locfit_1.5-9.4
[71] knitr_1.29 pillar_1.4.4 igraph_1.2.5 geneplotter_1.64.0 reshape2_1.4.4
[76] codetools_0.2-16 XML_3.99-0.3 glue_1.4.1 latticeExtra_0.6-29 BiocManager_1.30.10
[81] data.table_1.12.8 png_0.1-7 vctrs_0.3.1 foreach_1.5.0 tidyr_1.1.0
[86] gtable_0.3.0 purrr_0.3.4 xfun_0.15 xtable_1.8-4 viridisLite_0.3.0
[91] survival_3.2-3 tibble_3.0.1 rJava_0.9-12 iterators_1.0.12 memoise_1.1.0
[96] AnnotationDbi_1.48.0 cluster_2.1.0 ellipsis_0.3.1
Thanks, I solved my issue.
I got the OTU and taxonomy table (otutable and taxtable, respectively) and exported them as tsv file. So, I read them again each tsv separately with read.table, and build my DESeqDataSet from these.
Now, everything is fine. Thanks.