-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Package: MicEco | ||
Title: Various functions for microbial community data | ||
Version: 0.9.4 | ||
Version: 0.9.5 | ||
Authors@R: person("Jakob", "Russel", email = "[email protected]", role = c("aut", "cre")) | ||
Description: Collection of functions for microbiome analyses. E.g. fitting neutral models and standardized effect sizes of phylogenetic beta diversities, and much more. | ||
Depends: R (>= 3.2.5) | ||
Imports: stats, utils, phyloseq, foreach, doSNOW, picante, vegan, snow, bbmle, Hmisc, abind | ||
Imports: stats, utils, phyloseq, foreach, doSNOW, picante, vegan, snow, bbmle, Hmisc, abind, reshape2 | ||
License: GPL (>= 3) | file LICENSE | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 6.1.1 | ||
RoxygenNote: 7.0.2 | ||
Remotes: bioc::release/phyloseq |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#' Relevel the Sample variable in a psmelted phyloseq object | ||
#' | ||
#' Relevel the Sample variable in a psmelted phyloseq object, | ||
#' such that similar samples are plotted together with ggplot barcharts | ||
#' | ||
#' @param psmelted A phyloseq object melted into a data.frame with psmelt | ||
#' @param ... Arguments passed to hclust | ||
#' @importFrom reshape2 dcast | ||
#' @export | ||
ps_refactor <- function(psmelted, ...){ | ||
if(!is(psmelted, "data.frame")){ | ||
stop("Input should be a phyloseq object melted into a data.frame with psmelt") | ||
} | ||
mat <- reshape2::dcast(OTU ~ Sample, value.var = "Abundance", data = psmelted) | ||
hc <- hclust(dist(t(mat[, -1])), ...) | ||
psmelted$Sample <- factor(psmelted$Sample, levels = hc$labels[hc$order]) | ||
return(psmelted) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.