summarize.features {SIAMCAT} | R Documentation |
Summarize features
summarize.features(siamcat, level = 'g__', keep.original.names=TRUE, feature.type='original', verbose=1)
siamcat |
object of class siamcat-class |
level |
at which level to summarize (g__ = genus) |
keep.original.names |
boolean, should the original names be kept? |
feature.type |
On which type of features should the function work? Can be either "original", "filtered", or "normalized". Please only change this paramter if you know what you are doing! |
verbose |
control output: |
object of class siamcat-class with a summarized feature table
data("GlobalPatterns") ## phyloseq example data feat <- otu_table(GlobalPatterns)[1:500,] label <- create.label(meta=sample_data(GlobalPatterns), label = "SampleType", case = c("Freshwater", "Freshwater (creek)", "Ocean")) # rename features temp <- tax_table(GlobalPatterns)[1:500,] test <- apply(temp, 1, FUN=function(vec){ out <- '' for (i in seq_along(vec)){ end <- ifelse(i == ncol(temp), '', ';') x <- colnames(temp)[i] x2 <- tolower(substr(x, 1, 1)) out <- paste0(out, x2, '__', vec[i], end) } return(out)}) rownames(feat) <- test # run the constructor function siamcat <- siamcat(feat=feat, label=label) siamcat <- summarize.features(siamcat, level='g__', verbose=3)