Description Usage Arguments Value Author(s) See Also Examples
This function consumes OTU table(s) and (optionally) a taxonomic rank, then extracts the classification of each OTU at the given taxonomic rank, groups by classification at the given rank, removes all groups with only 0 counts, optionally removes all unclassified groups, sorts groups based on abundance, and then returns the transpose.
1 2 |
otu1 |
the first OTU table to be used. |
otu2 |
the second OTU table to be used. |
rank |
a character vector representing a rank. Must be in one of three specific formats (see ?RAM.rank.formatting for help). If omitted, the function will repeat for all seven major taxonomic ranks. |
drop.unclassified |
logical. Determine whether or not the OTUs labelled "unclassified" or missing classification at the given taxonomic rank should be excluded. |
top |
the number of groups to select, starting with the most abundant.
If |
count |
logical. Should the actual count of each OTU be shown, or should the relative abundances be shown? |
mode |
a character vector, one of " |
The value returned by this function may become nested lists, so for convenience, any nested lists have been given descriptive items names to make accessing its elements simple (see Examples).
If otu2
is given:
If rank
is given: a list containing two data
frames (otu1 and otu2 aggregated at the given rank).
If rank
is not given: a list containing two
lists. The first sublist represents otu1
, the
second otu2
. The sublists contain seven data
frames, the aggregation of the data at each taxonomic
rank (see Examples).
If otu2
is not given:
If rank
is given: a single data frame (otu1
aggregated at the given rank).
If rank
is not given: a list containing
seven data frames (otu1 aggregated at each taxonomic
rank).
Wen Chen and Joshua Simpson.
1 2 3 4 5 6 7 8 9 10 11 12 | data(ITS1, ITS2)
# aggregate based on phylum
ITS1.p <- tax.abund(ITS1, rank="p")
# aggregate based on all ranks; ignoring all unclassified OTUs
ITS1.taxa <- tax.abund(ITS1, drop.unclassified=FALSE)
# aggregate for one rank for both ITS1 and ITS2
lst <- tax.abund(ITS1, ITS2, rank="class")
# aggregate for all ranks for both ITS1 and ITS2
lst.all <- tax.abund(ITS1, ITS2)
stopifnot(identical(lst.all$otu1$phylum, ITS1.p))
# get the counts for all genera with relative abundance > 25%
tax.abund(ITS1, rank="g", top=25, mode="percent", count=TRUE)
|
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.4-4
Loading required package: ggplot2
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Fusarium unclassified_below_family Cryptococcus unidentified
P1001.1M1 21 2619 6058 1933
P1001.1M2 41 1950 4440 860
P1001.1M3 63 2383 9195 2344
P1001.1M4 7 289 1102 353
P1001.1M5 220 2082 4792 4734
P1001.1M6 77 1412 2643 2760
P1001.1M7 172 3538 5936 4711
P1001.1M8 354 2723 6532 5057
P1001.1M9 1138 7350 3071 2059
P1001.1M10 209 4062 1964 731
P1001.1M11 5409 5389 1371 2848
P1001.1M12 2561 6903 862 2434
P1001.1M13 14803 9037 627 1070
P1001.1M14 9303 9597 540 955
P1001.1M15 26138 5054 323 1036
P1001.1M16 23973 7014 569 1137
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.