LebeerLab / tidytacos

Functions to manipulate and visualize microbial community data
https://lebeerlab.github.io/tidytacos/
GNU General Public License v3.0
9 stars 1 forks source link

[BUG] create_tidytacos example problems #36

Closed david-barnett closed 1 month ago

david-barnett commented 1 month ago

create_tidytacos help page example doesn't create a usable tidytacos object, and doesn't give any guidance on how to continue.

library(tidytacos)

# example taken from create_tidytacos help page
x <- matrix(
  c(1500, 1300, 280, 356),
  ncol = 2
)
rownames(x) <- c("taxon1", "taxon2")
colnames(x) <- c("sample1", "sample2")

# Convert to tidytacos object
data <- create_tidytacos(x, taxa_are_columns = FALSE)

# tacoplot_stack has unstated requirements about the taxonomy table format?
data %>% tacoplot_stack()
#> Error in `mutate()`:
#> ℹ In argument: `best_classification = purrr::pmap_chr(...)`.
#> Caused by error in `ta$taxa[, rank_names]`:
#> ! Can't subset columns that don't exist.
#> ✖ Columns `kingdom`, `phylum`, `class`, `order`, `family`, etc. don't exist.

# not sure what is happening here, maybe tacoplot_ord doesn't like having only 2 samples?
data %>% tacoplot_ord(x = "sample_id")
#> Error in stats::cmdscale(dist_matrix, k = dims, eig = T, list = T, ...): 'k' must be in {1, 2, ..  n - 1}

# lastly, not sure what this bit is
tidytacos("a")
#> Error in tidytacos("a"): could not find function "tidytacos"

Created on 2024-07-26 with reprex v2.1.1

david-barnett commented 1 month ago

similar issue with test_taco()