| getStatistics {benchdamic} | R Documentation |
Extract the list of p-values or/and log fold changes from the output of a differential abundance detection method.
getStatistics( method, slot = "pValMat", colName = "rawP", type = "pvalue", direction = NULL, verbose = FALSE )
method |
Output of a differential abundance detection method.
|
slot |
The slot name where to extract values
(default |
colName |
The column name of the slot where to extract values
(default |
type |
The value type of the column selected where to extract values.
Two values are possible: |
direction |
|
verbose |
Boolean to display the kind of extracted values
(default |
A vector or a data.frame. 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.
data("ps_plaque_16S")
# Add scaling factors
ps_plaque_16S <- norm_edgeR(object = ps_plaque_16S, method = "TMM")
# DA analysis
da.limma <- DA_limma(
object = ps_plaque_16S,
design = ~ 1 + HMP_BODY_SUBSITE,
coef = 2,
norm = "TMM"
)
# get p-values
getStatistics(
method = da.limma, slot = "pValMat", colName = "rawP",
type = "pvalue", direction = NULL
)
# get negative abs(logFC) values
getStatistics(
method = da.limma, slot = "statInfo", colName = "logFC",
type = "logfc", direction = NULL
)
# get p-values and logFC
getStatistics(
method = da.limma, slot = "pValMat", colName = "rawP",
type = "pvalue", direction = "logFC"
)