Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
data tax table updates and plot_composition
- Loading branch information
Showing
19 changed files
with
181 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#' @title Default Colors | ||
#' @description Default colors for different variables. | ||
#' @param x Name of the variable type ("Phylum") | ||
#' @param v Optional. Vector of elements to color. | ||
#' @return Named character vector of default colors | ||
#' @author Leo Lahti \email{leo.lahti@@iki.fi} | ||
#' @references See citation("microbiome") | ||
#' @export | ||
#' @examples \dontrun{col <- default_colors("Phylum")} | ||
#' @keywords utilities | ||
default_colors <- function (x, v=NULL) { | ||
|
||
if (x == "Phylum") { | ||
#http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf | ||
#https://www.r-graph-gallery.com/42-colors-names/ | ||
col <- c( | ||
"Actinobacteria" = "darkgreen", | ||
"Firmicutes" = "blue", | ||
"Proteobacteria" = "black", | ||
"Verrucomicrobia" = "darkblue", | ||
"Bacteroidetes" = "red", | ||
"Spirochaetes" = "darkgray", | ||
"Fusobacteria" = "lightblue", | ||
"Cyanobacteria" = "deepskyblue3") | ||
} | ||
|
||
col | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#' @title Dominant taxa | ||
#' @description Returns the dominant taxonomic group for each sample. | ||
#' @param x A \code{\link{phyloseq-class}} object | ||
#' @return A vector of dominance indices | ||
#' @export | ||
#' @examples | ||
#' data(dietswap) | ||
#' # vector | ||
#' d <- dominant(dietswap) | ||
#' @author Leo Lahti \email{microbiome-admin@@googlegroups.com} | ||
#' @keywords utilities | ||
dominant <- function(x) { | ||
|
||
# TODO add support to other taxonomic levels | ||
taxa(x)[apply(abundances(x), 2, which.max)] | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.