This function extracts the results of posthoc test.
extract_posthoc_res(object, features = NULL)
a postHocTest
object.
either NULL
extracts results of all features, or a
character vector to specify the test resuts of which features are
extracted.
a IRanges::SimpleDFrameList
object.
require(IRanges)
#> Loading required package: IRanges
#> Loading required package: BiocGenerics
#>
#> Attaching package: ‘BiocGenerics’
#> The following objects are masked from ‘package:stats’:
#>
#> IQR, mad, sd, var, xtabs
#> The following objects are masked from ‘package:base’:
#>
#> Filter, Find, Map, Position, Reduce, anyDuplicated, append,
#> as.data.frame, basename, cbind, colnames, dirname, do.call,
#> duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
#> lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
#> pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table,
#> tapply, union, unique, unsplit, which.max, which.min
#> Loading required package: S4Vectors
#> Loading required package: stats4
#>
#> Attaching package: ‘S4Vectors’
#> The following objects are masked from ‘package:base’:
#>
#> I, expand.grid, unname
pht <- postHocTest(
result = DataFrameList(
featureA = DataFrame(
comparisons = c("group2-group1",
"group3-group1",
"group3-group2"),
diff_mean = runif(3),
pvalue = rep(0.01, 3),
ci_lower = rep(0.01, 3),
ci_upper = rep(0.011, 3)
),
featureB = DataFrame(
comparisons = c("group2-group1",
"group3-group1",
"group3-group2"),
diff_mean = runif(3),
pvalue = rep(0.01, 3),
ci_lower = rep(0.01, 3),
ci_upper = rep(0.011, 3)
)
),
abundance = data.frame(
featureA = runif(3),
featureB = runif(3),
group = c("group1", "group2", "grou3")
)
)
extract_posthoc_res(pht, "featureA")[[1]]
#> DataFrame with 3 rows and 5 columns
#> comparisons diff_mean pvalue ci_lower ci_upper
#> <character> <numeric> <numeric> <numeric> <numeric>
#> 1 group2-group1 0.830995 0.01 0.01 0.011
#> 2 group3-group1 0.269026 0.01 0.01 0.011
#> 3 group3-group2 0.507985 0.01 0.01 0.011