profile_taxa_by_samples: Profile taxa by samples

Description Usage Arguments Value

View source: R/tax.R

Description

Given a phyloseq object (with absolute abundance counts) and a taxonomic rank (character - one among 'rank_names(physeq)') it gives the taxa (by 'tax_rank') profiled by samples.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
profile_taxa_by_samples(
  physeq,
  tax_rank,
  count_type = "abs",
  col_bar = NULL,
  top_taxa = NULL,
  show_top = NULL,
  group = NULL,
  taxa_perc_cutoff = NULL,
  ord_by = FALSE,
  rm_na = FALSE,
  fill_other = FALSE,
  ...
)

Arguments

physeq

phyloseq-class object.

tax_rank

taxonomic rank (character). One of the taxonomic ranks among the column names of 'tax_table()' of the 'physeq' object given.

count_type

type of counts to perform 'rank_taxa()'. It can be absolute, i.e., 'abs', or percentage, i.e., 'perc' (character). Default is 'abs' - absolute counts.

col_bar

column bar to annotate samples (character). One character/factor variable among 'sample_variables(physeq)' to be used to annotate the samples. The maximum number of levels that the character/factor variable can have is 10.

top_taxa

top most abundant taxa to select by 'tax_rank' (numeric - coerced to integer) in the overall data set. Default 'NULL'. If 'count_type = perc', the percentage ranging from 0-100% will be determined for the 'top_taxa' only.

show_top

top n taxa to show (numeric - coerced to integer). Default is 'NULL'. The difference to 'top_taxa' is that if 'count_type = "perc"', the percentage presented still refers to the percentage of overall data before discarding the non-top n taxa.

group

factorial variable to group, one among 'sample_variables(physeq)'. Default is 'NULL'.

taxa_perc_cutoff

percentage cutoff to remove less abundant taxa than 'taxa_perc_cutoff'. Default is 'NULL'.

ord_by

logical (or character). Default is 'FALSE'. Order the samples (x-axis) by the levels from the character/factorial variable indicated at 'col_bar'. Only applied if 'col_bar' parameter is used. If provided a character of the 'col_bar' factor levels, the samples will be ordered by the 'col_bar' factor level provided.

rm_na

include (TRUE) or not (FALSE) NAs, i.e., taxa without classification at the taxonomic level specified at 'tax_rank'.

...

parameters to be passed to the function 'filter_feature_table()'.

Value

It returns a list with a tibble data frame ('$data') and ggplot ('$plot') profiling the taxa picked at the taxonomic rank select at 'tax_rank' by samples.


antonioggsousa/micrUBIfuns documentation built on Nov. 14, 2020, 1:40 a.m.