Code Monkey home page Code Monkey logo

microbiomeutilities's Introduction

R-CMD-check

NOTE While we continue to maintain this R package, the development has been discontinued as we have shifted to supporting methods development based on the new TreeSummarizedExperiment data container, which provides added capabilities for multi-omics data analysis. Check the miaverse project for details.

About

The microbiomeutilities R package is part of the microbiome-verse tools that provides additional data handling and visualization support for the microbiome R/BioC package

Philosophy: "Seemingly simple tasks for experienced R users can always be further simplified for novice users"

Package website and online documentation

Install microbiomeutilities

install.packages("devtools")
devtools::install_github("microsud/microbiomeutilities")

Citation:

o Leo Lahti, Sudarshan Shetty et al. (2017-2020). Tools for microbiome analysis in R. Version 2.1.28. URL: http://microbiome.github.com/microbiome
o Sudarshan A. Shetty, & Leo Lahti. (2020, October). microbiomeutilities: Utilities for Microbiome Analytics.

The microbiome R package relies on the independently developed
o phyloseq package and data structures for R-based microbiome analysis developed by Paul McMurdie and Susan Holmes.
o ggplot2 H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2009.
o tidyverse packages.

Microbiome package website with step-wise tutorials:
URL: http://microbiome.github.com/microbiome.

Tutorials

About the Author

MicrobiomeHD
The package provides access to a subset of studies included in the MicrobiomeHD database from Duvallet et al 2017: Meta-analysis of gut microbiome studies identifies disease-specific and shared responses. Nature communications. These datasets are converted to phyloseq objects and can be directly used in R environment.

Datasets from:

  • Duvallet, Claire, et al. "Meta-analysis of gut microbiome studies identifies disease-specific and shared responses." Nature communications 8.1 (2017): 1784.
  • Son, J. et al. Comparison of fecal microbiota in children with autism spectrum disorders and neurotypical siblings in the simons simplex collection. PLoS ONE 10, e0137725 (2015).
  • Kang, D. W. et al. Reduced incidence of Prevotella and other fermenters in intestinal microflora of autistic children. PLoS ONE8, e68322 (2013).
  • Schubert, A. M. et al. Microbiome data distinguish patients with clostridium difficile infection and non-c. difficile-associated diarrhea from healthy controls. mBio 5, e01021–14–e01021–14 (2014).
  • Youngster, I. et al. Fecal microbiota transplant for relapsing clostridium difficile infection using a frozen inoculum from unrelated donors: a randomized, open-label, controlled pilot study. Clin. Infect. Dis. 58, 1515–1522 (2014).
  • Baxter, N. T., Ruffin, M. T., Rogers, M. A. & Schloss, P. D. Microbiota-based model improves the sensitivity of fecal immunochemical test for detecting colonic lesions. Genome Med. 8, 37 (2016).
  • Zackular, Joseph P., et al. "The gut microbiome modulates colon tumorigenesis." MBio 4.6 (2013): e00692-13.
  • Zeller, G. et al. Potential of fecal microbiota for early-stage detection of colorectal cancer. Mol. Syst. Biol. 10, 766–766 (2014).
  • Singh, P. et al. Intestinal microbial communities associated with acute enteric infections and disease recovery. Microbiome 3, 45 (2015).
  • Noguera-Julian, M. et al. Gut microbiota linked to sexual preference and hiv infection. EBioMedicine 5, 135–146 (2016). Dinh, D. M. et al. Intestinal microbiota, microbial translocation, and systemic inflammation in chronic HIV infection. J. Infect. Dis. 211, 19–27 (2014).
  • Lozupone, C. A. et al. Alterations in the gut microbiota associated with hiv-1 infection. Cell Host Microbe 14, 329–339 (2013).
  • Gevers, D. et al. The treatment-naive microbiome in new-onset crohn’s disease. Cell Host Microbe 15, 382–392 (2014).
  • Zhang, Z. et al Large-scale survey of gut microbiota associated with MHE via 16s rRNA-based pyrosequencing. Am. J. Gastroenterol. 108, 1601–1611 (2013).
  • Wong, J. M. W., Souza, R. De, Kendall, C. W. C., Emam, A. & Jenkins, D. J. A. Colonic health: fermentation and short chain fatty acids. J. Clin. Gastroenterol. 40, 235–243 (2006).
  • Ross, M. C. et al. 16s gut community of the cameron county hispanic cohort. Microbiome 3, 7 (2015).
  • Zupancic, M. L. et al. Analysis of the gut microbiota in the old order Amish and its relation to the metabolic syndrome. PLoS ONE 7, e43052 (2012).
  • Scher, J. U. et al. Expansion of intestinal Prevotella copri correlates with enhanced susceptibility to arthritis. eLife 2, e01202 (2013).
  • Alkanani, A. K. et al. Alterations in intestinal microbiota correlate with susceptibility to type 1 diabetes. Diabetes 64, 3510–3520 (2015).
  • Scheperjans, F. et al Gut microbiota are related to parkinson’s disease and clinical phenotype. Mov. Disord. 30, 350–358 (2014).

NOTE:
The aim of this package is not to replace any of the other tools mentioned on this site.

Change log

CHANGES IN VERSION 1.00.16 (2021-04-14)
o Fix format_to_besthit to return all slots present in input.

CHANGES IN VERSION 1.00.15 (2021-01-21)
o Fix plot_taxa_cv to deal with taxa_are_rows==FALSE.

CHANGES IN VERSION 1.00.14 (2021-01-21)
o Added utilities within peak-methods.

CHANGES IN VERSION 1.00.12 (2021-01-18)
o Removed prevalence option plot_taxa_heatmap.

CHANGES IN VERSION 1.00.12 (2021-01-18)
o Bug fix format_to_besthit.

CHANGES IN VERSION 1.00.11 (2020-11-09)
o Small improvement in error handling. o Phyloseq slots to tibble o add_refseq for storing ASV sequences

CHANGES IN VERSION 1.00.10 (2020-11-02)
o Improve get_group_abundances documentation and code

CHANGES IN VERSION 1.00.09 (2020-10-21)
o Added longitudinal page to website
o Added new function plot_area
o Added new function plot_paired_abundances
o Added new function plot_spaghetti

CHANGES IN VERSION 1.00.08 (2020-10-17)
o Cosmetic updates

CHANGES IN VERSION 1.00.07 (2020-10-15)
o Update to plot_taxa_heatmap
o Fixed plot_abund_prev options
o Added plot_alpha_rcurve
CHANGES IN VERSION 1.00.06 (2020-10-13)
o Added new function dominant_taxa
o Removed plot_ternary due to clash between ggplot2 and ggtern
o Added new function find_samples_taxa

CHANGES IN VERSION 1.00.05 (2020-10-11)
o Added new function dominant_taxa
o Added new function get_group_abundances
o removed microbiome_pipeline

CHANGES IN VERSION 1.00.04 (2020-10-11)
o Added new function plasticity
o modified theme_biome_utils

CHANGES IN VERSION 1.00.03 (2020-10-04)
o Added new function plot_ternary
o Deprecated plot_select_taxa

CHANGES IN VERSION 1.00.02 (2020-10-04)
o Version tested with R version 4.0.2 (2020-10-04)
o Added new function plot_listed_taxa
o Deprecated plot_select_taxa
o Added option for half violin in boxplots

CHANGES IN VERSION 1.00.01 (2020-10-03) o Added new function plot_abund_prev
o Added new function simple_heatmap
o Added new function taxa_distribution
o Added a custom theme theme_biome_utils
o Added gghalves to imports
o Fixed microbiome_pipeline report

CHANGES IN VERSION 1.00.00 (2020-10-01)
o Version tested with R version 4.0.2 (2020-06-22)
o Fix typos in documentation
o Add prefix option to format_to_besthit
o Edited phy_to_ldf to speed up conversion
o Removed format_phyloseq function as it is redundant
o Speedup taxa_summary function
o Free up pheatmap option in plot_taxa_heatmap
o Updated for more info from print_ps output
o plot_taxa_boxplot now returns a faceted plot
o Added new function plot_diversity_stats
o R code styling styler::tidyverse_style()

References:

  1. Callahan, B. J., McMurdie, P. J. & Holmes, S. P. (2017). Exact sequence variants should replace operational taxonomic units in marker gene data analysis. bioRxiv, 113597.
  2. Callahan, B. J., McMurdie, P. J., Rosen, M. J., Han, A. W., Johnson, A. J. A. & Holmes, S. P. (2016). DADA2: high-resolution sample inference from Illumina amplicon data. Nature methods 13, 581-583.
  3. Caporaso, J. G., Kuczynski, J., Stombaugh, J., Bittinger, K., Bushman, F. D., Costello, E. K., Fierer, N., Peña, A. G., Goodrich, J. K. & Gordon, J. I. (2010). QIIME allows analysis of high-throughput community sequencing data. Nature methods 7, 335-336.
  4. Schloss, P. D., Westcott, S. L., Ryabin, T., Hall, J. R., Hartmann, M., Hollister, E. B., Lesniewski, R. A., Oakley, B. B., Parks, D. H. & Robinson, C. J. (2009). Introducing mothur: open-source, platform-independent, community-supported software for describing and comparing microbial communities. Applied and environmental microbiology 75, 7537-7541.
    Team, R. C. (2000). R language definition. Vienna, Austria: R foundation for statistical computing.

More useful resources:

  1. Ben J. Callahan and Colleagues: Bioconductor Workflow for Microbiome Data Analysis: from raw reads to community analyses.
  2. Comeau AM and Colleagues: Microbiome Helper: a Custom and Streamlined Workflow for Microbiome Research
  3. MicrobiomeHD A standardized database of human gut microbiome studies in health and disease Case-Control
  4. Rhea A pipeline with modular R scripts
  5. Phyloseq Import, share, and analyze microbiome census data using R

microbiomeutilities's People

Contributors

microsud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

microbiomeutilities's Issues

double genus name in heatmap

hello,
I generate the heatmap using the following code:

library(microbiomeutilities)
library(microbiome)
library(knitr)
library(tibble)
library(dplyr)
library(pheatmap)
library(RColorBrewer)
ps <-phyloseq
tax_tb <- as(tax_table(ps),"matrix") %>% 
  as.data.frame() %>% 
  rownames_to_column("ASV") %>% 
  mutate(Genus.Species = ifelse(!is.na(Species), paste0(Genus, ".", Species), Species)) %>% 
  select(-Species)   %>% 
  rename(Species = Genus.Species)

#tax_tb[1:30, 5:9]
rownames(tax_tb) <- tax_tb$ASV
tax_tb <- tax_tb[,-1]

tax_table(ps) <- tax_table(as.matrix(tax_tb))

ps.genus <- aggregate_taxa(ps, "Genus")
display.brewer.all()
grad_ab <- brewer.pal(11, "Spectral")
grad_ab_pal <- grad_ab 
gray_grad <- colorRampPalette(c("white", "steelblue"))
gray_grad_cols <- gray_grad(10)
meta_colors <- list(c("winter" = "#8dd3c7", 
                      "spring" = "#fb8072", 
                      "summer"="#b3de69",
                      "autumn"="#fbb4ae"))
names(meta_colors) <- c("season")
p <- plot_taxa_heatmap(ps.genus,
                       subset.top = 30,
                       VariableA = c("season"),
                       heatcolors = grad_ab_pal, 
                       transformation = "clr",
                       cluster_rows = T,
                       cluster_cols = T,
                       show_colnames = T,
                       annotation_colors=meta_colors)

however, the column names are double instead of single name:
Rplot42
how to correct the code to have only a single name?
the taxa table is as follow:
image

thank you.

Problem to install

Hi,
how can I download a zip file of microbiomeutilities 1.00.15 for manually installation?
I used devtools::install_github("microsud/microbiomeutilities")
but it failed saying "~/microbiomeutilities_1.00.16.tar.gz’ had non-zero exit status".
Thank you.
Fuad

get_group_abundances group argument without NULL as default

Hi, when running get_group_abundances, the default of "group" is NULL as stated in the documentation. However, if this argument was left missing, an error of argument "group" is missing, with no default could be seen. Is it a bug with the package?

Thank you!

error with plot_taxa_heatmap

Hello! I'm fairly new to your package, apologies if this issue is a syntax thing on my end. I'm trying to create a heatmap of a bacterial community dataset, but have run into an error. Here's my code and the error that I run into:

bact.heat <- plot_taxa_heatmap(top50.phy, subset.top = NA,
VariableA=c("tissue_type","field"),
heatcolors = grad_ab_pal,
transformation = "log10",
cluster_rows = T,
cluster_cols = T,
show_colnames = F,
annotation_colors=meta_colors)

Top NA OTUs selected
Error in seq_len(n) : argument must be coercible to non-negative integer

For context, I subsetted my phyloseq object to show the top 50 ASVs/OTUs before using this function to deal with a separate error. My thinking was that since some of my OTUs have very low abundances, the log10 transformation was producing negative values. However, I get the same error when I use "compositional" and "NA" for the transformation argument. This phyloseq object is transformed to relative abundances, but I also ran into this error using raw read counts. Any suggestions on how to troubleshoot?

Thanks,
Gillian

Error in `check_aesthetics()`: ! plot_ordination_utils

I am trying with my own phyloseq object (that works with plot_ordination) but when I try 👍

nmordinationbray = ordinate(ps_aa, method="NMDS", distance = "bray") plot_ordination_utils(ps_aa, nmordinationbray, color = "group", plot.arrow = TRUE, scale.arrow = NULL, top.taxa = 5)

I receive:

Error in check_aesthetics(): ! Aesthetics must be either length 1 or the same as the data (1): xend and yend Run rlang::last_error() to see where the error occurred.

Plot_spaghetti - same results each result-cell. Idea about why?

Hi! I would like to "plot_spaghetti", but I am getting results assume to be wrong as they are the same for all subjects. Do you have any idea about why that is?

plot_spaghetti(physeq_RA_aggregated, plot.var= "by_sample",
               select.taxa=tax,
               group= "host_study_id",
               xvar="time",
               line.bg.color="#8d99ae",
               focus.color="brown3",
               focus.line.size = 1,
               ncol=5,
               nrow=6,
               line.size=0.2)

image

Thanks, Maria

format_to_besthit edit

Hello! Thank you for this package it has been really helpful.

I was trying to use the format_to_besthit to add arrows to my ordination plot. My tax table includes the string of bases instead of a name, so that complicates seeing the actual bacteria genus on the graph. I tried exporting the mds an deleting the string, re uploading and putting it into the phyloseq object/ordination with errors.
Thanks!

Code with ps2f taxtable and orddi edits

ps1 <- ps_shrimp
ps2 <- tax_glom(ps1, "Genus")
ps2f <- format_to_besthit(ps2, prefix="OTU-")
orddi <- ordinate(ps2f, method = "NMDS", distance = "bray")

alltaxa <- ps2f@tax_table
alltaxa <- as.list.data.frame(alltaxa)
rownamesalltaxa <- rownames(alltaxa)
write.csv(alltaxa,"Miseq2/alltaxa.csv", row.names = FALSE)

=TRIM(RIGHT(G2, LEN(G2) - SEARCH(":", G2)))
alltaxa <- as.matrix(alltaxa)

write.csv(rownamesalltaxa,"Miseq2/rownamesalltaxa.csv", row.names = FALSE)
rownamesalltaxa <- as.data.frame(rownamesalltaxa)

change names in excel using =TRIM(RIGHT(A2, LEN(A2) - SEARCH(":", A2))) and re upload
rownames(alltaxa) <- rownamesalltaxa$X1 *rename alltaxa rows with the edited cut off
alltaxa <- tax_table(alltaxa)

species <- orddi$species
species_genus <- rownames(species)
write.csv(species,"Miseq2/species_genus.csv", row.names = FALSE)

change names in excel using =TRIM(RIGHT(A2, LEN(A2) - SEARCH(":", A2))) and re upload

ps2f@tax_table <- alltaxa
rownames(species) <- species_genus$X1
orddi$species <- species

p <- plot_ordination_utils(ps2f, orddi,
color = "Neotrypaea", plot.arrow = TRUE,
scale.arrow = 1.3, top.taxa = 10
)

}

p

Error if I try to create a tax table with edited rownames:

rownames(alltaxa) <- rownamesalltaxa$x #rename alltaxa rows with the edited cut off
Warning: Setting row names on a tibble is deprecated.
Warning: non-unique values when setting 'row.names': ‘endosymbionts’, ‘Incertae Sedis’
Error in .rowNamesDF<-(x, value = value) :
duplicate 'row.names' are not allowed

Error if I edit best_hit in the tax table + species in orddi:

p <- plot_ordination_utils(ps2f, orddi,
color = "Neotrypaea", plot.arrow = TRUE,
scale.arrow = 1.3, top.taxa = 10
)
Species coordinates not found directly in ordination object. Attempting weighted average (vegan::wascores)

Main Issue: Labels!

image

Update readme and website

Suggest one citation for both microbiome and microbiomeutilities as a part of the microbiome-verse idea?
Link pkg website with main page for microbiome
@antagomir thoughts?

Taxonomic levels should be either 6 (untill genus) or 7 (until species) level

Hello,

I'm working with 16S data, and have an additional domain column in my tax_table of my phyloseq object. Is there any way I can still make boxplots for specific taxa using your package?

My phyloseq object info:
phyloseq-class experiment-level object
otu_table() OTU Table: [ 15 taxa and 14 samples ]
sample_data() Sample Data: [ 14 samples by 19 sample variables ]
tax_table() Taxonomy Table: [ 15 taxa by 8 taxonomic ranks ]

And specific code I'm trying to use:
p0 <- phy_prune_pa_exp_noChloro_noMito_f__OM190
p0.f <- format_to_besthit(p0)
select.taxa <- c("f__OM190")
mycols <- c("brown3", "steelblue")
p <- plot_listed_taxa(p0, select.taxa, group = "treatment", add.violin = TRUE, group.colors = mycols )

plot_taxa_barplot -

Hi! I am using the function plot_taxa_barplot and got a question; the input data is as counts, but on the y-axis of the plot it says "relative abundance %". My output shows that I got several at 100% and of that I am surprised. Should I transform my data prior input? THis only applies to genus level data, not e.g phylum level.

image

Thanks!

plot_taxa_boxplot error

when attempting to plot_taxa_boxplot I get the following error.
image
I don't get the error when using the test data phyloseq object. there are some data type differences between my phyloseq object and the test data object but I'm not sure what would cause the error.

my phyloseq object
image

zackular phyloseq object
image

A

A

heatmap

hello, I would like to ask your help if possible.
I used the microbiomeutilities to generate a heatmap from my biom file and I go the species of my otu.
is there isn't any other way to specify which taxa-level to plot as heat map?.
also is possible to omit the prevalence function?
thank you for your help.
I attached the map I generated.

Unable to change levels of group variable in plot_paired_abundances

Hi!
I want to plot_paired_abundances, and are successfully able. However, i would like to change the levels of the group (currently they are post-pre, want it to be pre-post). When I do with this code:
sample_data(p_kombucha_agg)$pre_post <- factor(sample_data(p_kombucha_agg)$pre_post, levels=c('pre', 'post'))
it changes from being a character to a factor. Then running the code I get the following error message (which seem unrelated to the actual problem).

_Error in filter():
! Problem while computing ..1 = group == unique(xmeta_lf_2$group)[1].
✖ Input ..1 must be of size 6 or 1, not size 0.
ℹ The error occurred in group 1: taxa = "d__Bacteria;p__Firmicutes;c__Bacilli;o__Bacillales_B;f__Bacillaceae_C;g__Weizmannia", linevar = 2003.
Backtrace:

  1. microbiomeutilities::plot_paired_abundances(...)
  2. dplyr:::filter.data.frame(., group == unique(xmeta_lf_2$group)[1])_

My question; how can I change the levels of my group variable?
Thanks for a great package!!

Phy_tree not included in the result of format_to_besthit

Is there a way to include the phy_tree in the phyloseq object after using the format_to_besthit function? Ive been following this commands and I need to measure the unifrac distances based on the phylogenetic tree but after using the format_to_besthit, it turns out the phy_tree was not included.

ps2 <- tax_glom(ps, "genus")
ps2f <- format_to_besthit(ps)
orddi <- ordinate(ps2f, method = "PCoA", distance = "unifrac", weighted= FALSE)
Error in access(physeq, "phy_tree", errorIfNULL) :
phy_tree slot is empty.

Unable to install microbiome utilities

Hi,

I am getting the following error when trying to install. Can you kindly help in sintalling the package.

Thanks
Yugandhar

devtools::install_github("microsud/microbiomeutilities")
Error in utils::download.file(url, path, method = download_method(), quiet = quiet, :
cannot open destfile 'C:\Users\YUGAND1.S1\AppData\Local\Temp\RtmpEnHf9c\filef304bc37608', reason 'No such file or directory'
Error in gzfile(file, mode) : cannot open the connection
In addition: Warning message:
In gzfile(file, mode) :
cannot open compressed file 'C:\Users\YUGAND
1.S1\AppData\Local\Temp\RtmpEnHf9c/libloc_208_89adf02.rds', probable reason 'No such file or directory'

White grid in plot_taxa_heatmap

Hi,

I can't seem to figure out why but when using the plot_taxa_heatmap function, it always returns a heatmap with each cell separated by a small white border. I guess there is some setting which can be passed to pheatmap to alter this behaviour but I can't find out which. Do you have any idea? I attached an example of the output.
Rplot

Relative abundance plot for selected taxa

i tried to use code from microbiomeutilites package to make a relative abundance plot for selected taxa across different groups but the code doesn't work , even i tried to rerun your code using your example data
E

rlang::last_error()

pn_phylum <- plot_taxa_boxplot(phy,

  •                     taxonomic.level = "Phylum",
    
  •                     top.otu = 10, group = "treatment",
    
  •                     title = "Rel plot", group.colors = "Set2")
    

The phy_tree slot is empty, easy to make the plot
错误: More than one expression parsed
Run rlang::last_error() to see where the error occurred.

Problem to load

Hi there,

I installed microbiomeutilities on our Rocky Linux 9 system, with R version 4.3.2.
I did not get any ERROR but only warinigs:

`> devtools::install_github("microsud/microbiomeutilities",force=T)
Downloading GitHub repo microsud/microbiomeutilities@HEAD
Skipping 3 packages not available: Biostrings, microbiome, phyloseq
── R CMD build ───────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/tmp/Rtmp89BVzJ/remotes63a264c7e39b/microsud-microbiomeutilities-046a9f9/DESCRIPTION’ ...
─ preparing ‘microbiomeutilities’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘microbiomeutilities_1.00.17.tar.gz’

Installing package into ‘/home/silviat/R/x86_64-redhat-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)

  • installing source package ‘microbiomeutilities’ ...
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    Warning: replacing previous import ‘ggplot2::alpha’ by ‘microbiome::alpha’ when loading ‘microbiomeutilities’
    ** help
    *** installing help indices
    converting help for package ‘microbiomeutilities’
    finding HTML links ... done
    add_refseq html
    finding level-2 HTML links ... done

    aggregate_top_taxa2 html
    dominant_taxa html
    find_samples_taxa html
    format_to_besthit html
    get_group_abundances html
    get_microbiome_data html
    get_tibble html
    hmp2 html
    join_otu_tax html
    list_microbiome_data html
    make_pairs html
    peak-methods html
    percent_classified html
    phy_to_ldf html
    plasticity html
    plot_abund_prev html
    plot_alpha_diversities html
    plot_alpha_rcurve html
    plot_area html
    plot_diversity_stats html
    plot_listed_taxa html
    plot_ordination_utils html
    plot_ordiplot_core html
    plot_paired_abundances html
    plot_read_distribution html
    plot_select_taxa html
    plot_spaghetti html
    plot_taxa_boxplot html
    plot_taxa_composition html
    plot_taxa_cv html
    plot_taxa_heatmap html
    prep_tern_otu html
    prep_ternary html
    print_ps html
    rarefy_util html
    simple_heatmap html
    taxa_distribution html
    taxa_pooler_mcola html
    taxa_summary html
    theme_biome_utils html
    zackular2014 html
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    Warning: replacing previous import ‘ggplot2::alpha’ by ‘microbiome::alpha’ when loading ‘microbiomeutilities’
    ** testing if installed package can be loaded from final location
    Warning: replacing previous import ‘ggplot2::alpha’ by ‘microbiome::alpha’ when loading ‘microbiomeutilities’
    ** testing if installed package keeps a record of temporary installation path

  • DONE (microbiomeutilities)`

But if I then load the package:
library("microbiomeutilities")
I get:

library("microbiomeutilities")
Error: package or namespace load failed for ‘microbiomeutilities’:
(converted from warning) replacing previous import ‘ggplot2::alpha’ by ‘microbiome::alpha’ when loading ‘microbiomeutilities’

What could be the problem??
Thanks

Error with plot_taxa_cv()

Hello,

Thanks for a great package! I am running into this error when attempting to run plot_taxa_cv() on my phyloseq object:

Here is my phyloseq information:
> merged_phyloseq_80 phyloseq-class experiment-level object otu_table() OTU Table: [ 32450 taxa and 69 samples ] sample_data() Sample Data: [ 69 samples by 10 sample variables ] tax_table() Taxonomy Table: [ 32450 taxa by 9 taxonomic ranks ]

Here is the error:
> p1 <- plot_taxa_cv(merged_phyloseq_80, plot.type = "scatter") Error: Problem with mutate()inputMeanAbun. x Input MeanAbuncan't be recycled to size 32450. ℹ InputMeanAbunisx.mean.rel. ℹ Input MeanAbun must be size 32450 or 1, not 69.

Here is the error in more detail:
├─<error/dplyr:::mutate_error> │ Problem with mutate()inputMeanAbun. │ x Input MeanAbuncan't be recycled to size 32450. │ ℹ InputMeanAbunisx.mean.rel. │ ℹ Input MeanAbun` must be size 32450 or 1, not 69.
└─<error/dplyr:::mutate_incompatible_size>
Backtrace:

  1. ├─microbiomeutilities::plot_taxa_cv(merged_phyloseq_80, plot.type = "scatter")
  2. │ └─%>%(...)
  3. ├─dplyr::mutate(., MeanAbun = x.mean.rel, CV = x.cvs)
  4. ├─dplyr:::mutate.data.frame(., MeanAbun = x.mean.rel, CV = x.cvs)
  5. │ └─dplyr:::mutate_cols(.data, ...)
  6. │ ├─base::withCallingHandlers(...)
  7. │ └─mask$eval_all_mutate(quo)
  8. └─dplyr:::abort_glue(character(0), list(x_size = 69L), "dplyr:::mutate_incompatible_size")
  9. └─rlang::exec(abort, class = class, !!!data)`

Please let me know if there is something wrong with my phyloseq object that is causing this error - I'm not sure I am catching it if that's the case. The example with the zackular2014 works fine.

workflowr

You make like to have a look at the recently released workflowr package.

Taxonomic_Levels Percent_Classification

Hi,
I am trying to identify my dataset taxonomic resolution using microbiomeutilities package. I found a small problem in calculation. The domain and Phylum percent classification should be 100% in my dataset. But I get the following.

##upload required libraries
library(phyloseq)
library(file2meco)
library(microbiomeutilities)
library(ggplot2)

#taxonomy resolution calculation
percent_classified(pseq)

##output
Taxonomic_Levels Percent_Classification
1 Domain 99.9998 %
2 Phylum 99.9998 %
3 Class 99.9442 %
4 Order 99.7169 %
5 Family 98.2093 %
6 Genus 94.0961 %
7 Species 59.1211 %
8 OTUs/ASVs 438997

Could you kindly provide me the reason or any correction needed? I have attached my dataset for your reference.
physeq.rds.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.