grunwaldlab / metacoder

Parsing, Manipulation, and Visualization of Metabarcoding/Taxonomic data
http://grunwaldlab.github.io/metacoder_documentation
Other
134 stars 28 forks source link

Error: 'filter_taxa' is not an exported object from 'namespace:taxa' #361

Closed dhadsell closed 5 months ago

dhadsell commented 8 months ago

Hello, I have really appreciated the information in your workshops page, but I have ran intro an error when I try to plot heatmap tree with log2 ratio

Error: 'filter_taxa' is not an exported object from 'namespace:taxa'

I used the following commands and they produced the above error

obj$data$tax_abund <- calc_taxon_abund(obj, "otu_rarefied", cols = sample_data$SampleID)

obj$data$diff_table <- compare_groups(obj, data = "tax_abund", cols = sample_data$SampleID, groups = sample_data$Cover) set.seed(1) obj %>% mutate_obs("cleaned_names", gsub(taxon_names, pattern = "\[|\]", replacement = "")) %>% taxa::filter_taxa(grepl(cleaned_names, pattern = "^[a-zA-Z]+$")) %>% heat_tree(node_label = cleaned_names, node_size = n_obs, # number of OTUs node_color = log2_median_ratio, # difference between groups node_color_interval = c(-10, 10), # symmetric interval node_color_range = c("cyan", "gray", "magenta"), # diverging colors node_size_axis_label = "OTU count", node_color_axis_label = "Log 2 ratio of median counts", layout = "da", initial_layout = "re", # good layout for large trees title = "Covered vs Open samples")

I thought that this was related to issue #228 and tried using devtools::install_github("ropensci/taxa") this did not fix it.

Any help appreciated!

zachary-foster commented 8 months ago

Hmm, that looks like old example code, back when we were using the taxa package. We will use it again in the future, but for now an older version of taxa is included in metacoder. Can you send me the link to the page that contains this example code? I thought it was all updated.

dhadsell commented 7 months ago

Hello, the link for the example script is from the workshop page. I repeated ths script using only the datasets given with the workshop and it still gives the error - Error: 'filter_taxa' is not an exported object from 'namespace:taxa

'https://grunwaldlab.github.io/analysis_of_microbiome_community_data_in_r/07--diversity_stats.html

zachary-foster commented 7 months ago

Yea, that's because that webpage it outdated now. All that has been updated in the metacoder documentation page, which is a different site:

https://grunwaldlab.github.io/metacoder_documentation/

I have taken down the old workshop site to avoid confusion.

dhadsell commented 5 months ago

Hi The new metacoder site solved this issue for me

Thank you