{
# Load data
data(testotu)
# Create group information data frame
groupinformation <- data.frame(
group = c(rep("a", 10), rep("b", 10)),
factor1 = rnorm(10),
factor2 = rnorm(mean = 100, 10),
subject = factor(c(1:10, 1:10))
)
# Packaging data into a taxonomy summary object
test_object <- tax_summary(
groupfile = groupinformation,
inputtable = testotu[, 2:21],
reads = TRUE,
taxonomytable = testotu[, c(1, 22)]
)
# Check integrated object
print(test_object)
# Extract genus relative abundance table
test_Genus <- test_object$Genus_percent
head(test_Genus)
# Check corresponding taxonomy information of genus table
test_Genus_tax <- test_object$Genus_taxonomy
head(test_Genus_tax)
# Summary base table into all taxonomy levels with standard output
test_object <- tax_summary(
groupfile = groupinformation,
inputtable = testotu[, 2:21],
reads = TRUE,
taxonomytable = testotu[, c(1, 22)],
outputtax = "standard"
)
head(test_object$Species_percent) # View first 10 rows of species percentage
head(test_object$Genus) # View first 10 rows of genus table
}
Run the code above in your browser using DataLab