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

Is there a minimum number of samples required for testBetaDiversity? #142

Open
emi-panzetta opened this issue Dec 27, 2023 · 0 comments
Open

Comments

@emi-panzetta
Copy link

Hi, I appreciate your help. I ran testBetaDiversity in a subset of samples of a phyloseq object successfully (75 samples), then I try to do the same in a smaller subset of the samples (6 samples, 3 in each group) and I get this error:

Is there a minimum number of samples required for this function?

sample_data(ps)
X1 <- diag(nrow(sample_data(ps)))
colnames(X1) <- rownames(X1) <- as.character(1:ncol(X1))

divnetgenus <- divnet(W = ps,
X = X1,
variance = "none")

sample_data(ps)$myvariable <- as.factor (sample_data(ps)$myvariable)

set.seed(2)
bc_g_test <- testBetaDiversity(dv = divnetgenus,
h0 = "bray-curtis",
n_boot = 10000,
sample_specimen_matrix = divnetgenus$X,
groups = sample_data(ps)$myvariable)

Error in apply(dv$fitted_z[samples, ], 2, median) :
dim(X) must have a positive length

sessioninfo
R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/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 stats graphics grDevices utils datasets methods
[8] base

other attached packages:
[1] dada2_1.26.0 Rcpp_1.0.11 doSNOW_1.0.20
[4] snow_0.4-4 doParallel_1.0.17 iterators_1.0.14
[7] foreach_1.5.2 writexl_1.4.2 DivNet_0.4.0
[10] breakaway_4.8.4 magrittr_2.0.3 gridExtra_2.3
[13] lubridate_1.9.2 forcats_1.0.0 stringr_1.5.0
[16] purrr_1.0.2 readr_2.1.4 tidyr_1.3.0
[19] tibble_3.2.1 tidyverse_2.0.0 ggtext_0.1.2
[22] speedyseq_0.5.3.9018 microViz_0.10.6 phyloseq_1.42.0
[25] scales_1.2.1 ggplot2_3.4.4 car_3.1-2
[28] carData_3.0-5 lme4_1.1-34 Matrix_1.5-4.1
[31] dplyr_1.1.3 readxl_1.4.3

loaded via a namespace (and not attached):
[1] plyr_1.8.8 igraph_1.5.1
[3] splines_4.2.2 BiocParallel_1.32.6
[5] GenomeInfoDb_1.34.9 digest_0.6.33
[7] ca_0.71.1 htmltools_0.5.6.1
[9] fansi_1.0.5 cluster_2.1.4
[11] tzdb_0.4.0 Biostrings_2.66.0
[13] RcppParallel_5.1.7 matrixStats_1.0.0
[15] vroom_1.6.4 timechange_0.2.0
[17] jpeg_0.1-10 colorspace_2.1-0
[19] xfun_0.40 crayon_1.5.2
[21] RCurl_1.98-1.12 jsonlite_1.8.7
[23] survival_3.5-7 ape_5.7-1
[25] glue_1.6.2 registry_0.5-1
[27] gtable_0.3.4 zlibbioc_1.44.0
[29] XVector_0.38.0 DelayedArray_0.24.0
[31] Rhdf5lib_1.20.0 BiocGenerics_0.44.0
[33] abind_1.4-5 DBI_1.1.3
[35] gridtext_0.1.5 bit_4.0.5
[37] stats4_4.2.2 RColorBrewer_1.1-3
[39] pkgconfig_2.0.3 farver_2.1.1
[41] deldir_1.0-9 utf8_1.2.4
[43] tidyselect_1.2.0 labeling_0.4.3
[45] rlang_1.1.1 reshape2_1.4.4
[47] munsell_0.5.0 cellranger_1.1.0
[49] tools_4.2.2 cli_3.6.1
[51] generics_0.1.3 ade4_1.7-22
[53] evaluate_0.22 biomformat_1.26.0
[55] fastmap_1.1.1 yaml_2.3.7
[57] bit64_4.0.5 knitr_1.45
[59] nlme_3.1-163 mvnfast_0.2.8
[61] xml2_1.3.5 compiler_4.2.2
[63] rstudioapi_0.15.0 png_0.1-8
[65] stringi_1.7.12 lattice_0.21-8
[67] commonmark_1.9.0 nloptr_2.0.3
[69] markdown_1.8 vegan_2.6-4
[71] microbiome_1.20.0 permute_0.9-7
[73] multtest_2.54.0 vctrs_0.6.4
[75] pillar_1.9.0 lifecycle_1.0.3
[77] rhdf5filters_1.10.1 BiocManager_1.30.22
[79] data.table_1.14.8 bitops_1.0-7
[81] seriation_1.4.2 patchwork_1.1.3
[83] GenomicRanges_1.50.2 R6_2.5.1
[85] latticeExtra_0.6-30 hwriter_1.3.2.1
[87] TSP_1.2-4 ShortRead_1.56.1
[89] IRanges_2.32.0 codetools_0.2-19
[91] boot_1.3-28.1 MASS_7.3-60
[93] rhdf5_2.42.1 SummarizedExperiment_1.28.0
[95] withr_2.5.2 GenomicAlignments_1.34.1
[97] Rsamtools_2.14.0 S4Vectors_0.36.2
[99] GenomeInfoDbData_1.2.9 mgcv_1.9-0
[101] hms_1.1.3 grid_4.2.2
[103] minqa_1.2.5 rmarkdown_2.25
[105] MatrixGenerics_1.10.0 Rtsne_0.16
[107] Biobase_2.58.0 interp_1.1-4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant