Skip to content

Commit

Permalink
Modify top_taxa to return a matrix.
Browse files Browse the repository at this point in the history
  • Loading branch information
mahendra-mariadassou committed May 30, 2019
1 parent 0e94237 commit 09f8fd2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R/graphical_methods.R
Original file line number Diff line number Diff line change
@@ -201,7 +201,7 @@ top_taxa_abundance<- function(physeq, numberOfTaxa = 9, raw = FALSE) {
#' @param taxaRank taxonomic level used for agglomeration. Default NULL, equivalent to \code{taxaRank = "OTU"} and no agglomeration.
#' @param numberOfTaxa Number of top taxa to return
#'
#' @return A character vector the the `numberOfTaxa` most abundant `taxaRank`-level taxa
#' @return A matrix corresponding to the `numberOfTaxa` most abundant taxa at level `taxaRank`-level
#' @export
#'
#' @examples
@@ -224,7 +224,7 @@ top_taxa <- function(physeq, taxaRank = NULL, numberOfTaxa = 9) {
head(n = min(numberOfTaxa, ntaxa(physeq))) %>%
names()
## Corresponding names
tax_table(physeq)[top_taxa, taxaRank] %>% as.character()
tax_table(physeq)[top_taxa, 1:match(taxaRank, rank_names(physeq))] %>% as('matrix')
}

## Find numberOfConditions most abundant conditions in variable
@@ -430,7 +430,6 @@ gg_color_hue <- function(n) {
scales::hue_pal()(n)
}


## Plotting fonction once library sizes have been estimated
ggnorm <- function(physeq, cds, x = "X.SampleID", color = NULL, title = NULL) {
## Args:

0 comments on commit 09f8fd2

Please sign in to comment.