Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakob Russel committed Jan 15, 2020
1 parent 0be90c2 commit 9a92526
Show file tree
Hide file tree
Showing 17 changed files with 148 additions and 41 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
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 = "russel2620@gmail.com", 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
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export(community_rrna)
export(neutral.fit)
export(neutral.rand)
export(proportionality)
export(ps_refactor)
export(rarefy_rrna)
export(rarefy_rrna.matrix)
export(rarefy_rrna.phyloseq)
Expand All @@ -30,6 +31,7 @@ import(picante)
import(utils)
import(vegan)
importFrom(abind,abind)
importFrom(reshape2,dcast)
importFrom(stats,as.dist)
importFrom(stats,cov)
importFrom(stats,dnorm)
Expand Down
18 changes: 18 additions & 0 deletions R/ps_refactor.R
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)
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Calculate the unbiased effect size estimation (partial) omega-squared for adonis

Rarefaction curve (theoretical and fast) from a phyloseq object. Output ready for plotting in ggplot2

#### ps_refactor

Relevel the Sample variable in a psmelted phyloseq object, such that similar samples are plotted together with ggplot barcharts.

#### UniFrac.multi

With unrooted phylogenies UniFrac sets the root randomly on the tree.
Expand Down
3 changes: 1 addition & 2 deletions man/comdist.par.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions man/comdistnt.par.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions man/neutral.rand.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions man/ps_refactor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/rarefy_rrna.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/rcurve.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions man/ses.UniFrac.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions man/ses.comdist.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions man/ses.comdist2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions man/ses.comdistnt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions man/ses.comdistnt2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions man/ses.mntd.par.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions man/ses.mpd.par.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9a92526

Please sign in to comment.