extractStatistics | R Documentation |
Extract the list of p-values or/and log fold changes from the outputs of the differential abundance detection methods.
extractStatistics( object, slot = "pValMat", colName = "rawP", type = "pvalue", direction = NULL, verbose = FALSE )
object |
Output of differential abundance detection methods.
|
slot |
A character vector with 1 or number-of-methods-times repeats of
the slot names where to extract values for each method
(default |
colName |
A character vector with 1 or number-of-methods-times repeats
of the column name of the slot where to extract values for each method
(default |
type |
A character vector with 1 or number-of-methods-times repeats
of the value type of the column selected where to extract values for each
method. Two values are possible: |
direction |
A character vector with 1 or number-of-methods-times repeats
of the |
verbose |
Boolean to display the kind of extracted values
(default |
A vector or a data.frame
for each method. If
direction = NULL
, the colname
column values, transformed
according to type
(not tranformed if type = "pvalue"
,
-abs(value)
if type = "logfc"
), of the slot
are reported
, otherwise the direction
column of the statInfo
matrix is
added to the output.
getStatistics
data("ps_plaque_16S") # Add scaling factors my_norm <- setNormalizations(fun = c("norm_edgeR", "norm_CSS"), method = c("TMM", "CSS")) ps_plaque_16S <- runNormalizations(normalization_list = my_norm, object = ps_plaque_16S) # Perform DA analysis my_methods <- set_limma(design = ~ 1 + HMP_BODY_SUBSITE, coef = 2, norm = c("TMM", "CSS")) Plaque_16S_DA <- runDA(method_list = my_methods, object = ps_plaque_16S) ### Extract statistics for concordance analysis: # Only p-values extracted_pvalues <- extractStatistics( object = Plaque_16S_DA, slot = "pValMat", colName = "rawP", type = "pvalue" ) # Only transformed log fold changes -abs(logFC) extracted_abslfc <- extractStatistics( object = Plaque_16S_DA, slot = "statInfo", colName = "logFC", type = "logfc" ) # Only transformed log fold changes for a method and p-values for the other extracted_abslfc_pvalues <- extractStatistics( object = Plaque_16S_DA, slot = c("statInfo", "pValMat"), colName = c("logFC", "rawP"), type = c("logfc", "pvalue") ) ### Extract statistics for enrichment analysis: # p-values and log fold changes extracted_pvalues_and_lfc <- extractStatistics( object = Plaque_16S_DA, slot = "pValMat", colName = "rawP", type = "pvalue", direction = "logFC" ) # transformed log fold changes and untouched log fold changes extracted_abslfc_and_lfc <- extractStatistics( object = Plaque_16S_DA, slot = "statInfo", colName = "logFC", type = "logfc", direction = "logFC" ) # Only transformed log fold changes for a method and p-values for the other extracted_mix <- extractStatistics( object = Plaque_16S_DA, slot = c("statInfo", "pValMat"), colName = c("logFC", "rawP"), type = c("logfc", "pvalue"), direction = "logFC" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.