An S4 class to store the results of a differential analysis, as generated
by differential_binding or differential_accessibility. It contains
the full analysis table, subsets of significantly changed regions,
and associated metadata.
Slots
analysisA `data.frame` containing the full differential analysis table from `limma` or `NOISeq`.
upCond1A `data.frame` of regions significantly enriched in the first condition.
upCond2A `data.frame` of regions significantly enriched in the second condition.
condA named `character` vector mapping user-friendly display names (the names) to the internal condition identifiers (the values) used in the analysis.
dataA `list` containing the initial input data used for the analysis, including the occupancy `data.frame` and other metadata.
Accessor Methods
The following accessor functions are available for a DamIDResults object.
analysisTable(object): Returns the full differential analysis table (adata.frame).enrichedCond1(object): Returns adata.frameof regions significantly enriched in the first condition.enrichedCond2(object): Returns adata.frameof regions significantly enriched in the second condition.conditionNames(object): Returns a namedcharactervector mapping display names to internal identifiers.inputData(object): Returns alistcontaining the original input data used for the analysis.expressed(object, condition, fdr = 0.05, which = "any"): Returns adata.frameof genes considered expressed in `condition`, based on an FDR threshold of significantly enriched occupancy. Only available for analyses with FDR calculations, generated viaload_data_genes(calculate_fdr = TRUE).
Generic Methods
The generic plot() function is also S4-enabled for this class.
Calling plot(object) is equivalent to calling
plot_volcano(diff_results = object).
See also
For more powerful and specific plotting functions,
see plot_volcano, plot_venn,
and analyse_go_enrichment.
To explore the differential analysis results in an interactive IGV browser
window, see browse_igv_regions
Examples
# Helper function to create a sample DamIDResults object for examples
.generate_example_results <- function() {
analysis_df <- data.frame(
logFC = c(2, -2, 0.1), P.Value = c(0.01, 0.01, 0.9), B = c(4, 3, -1),
gene_name = c("GeneA", "GeneB", "GeneC"),
row.names = c("chr1:1-100", "chr1:101-200", "chr1:201-300")
)
new("DamIDResults",
analysis = analysis_df,
upCond1 = analysis_df[1, , drop = FALSE],
upCond2 = analysis_df[2, , drop = FALSE],
cond = c("Condition 1" = "C1", "Condition 2" = "C2"),
data = list(test_category = "bound")
)
}
mock_results <- .generate_example_results()
# Show the object summary
mock_results
#> An object of class 'DamIDResults'
#> Differentially bound regions
#> Comparison: 'Condition 1' vs 'Condition 2'
#> - 1 regions enriched in Condition 1
#> - 1 regions enriched in Condition 2
#> - 3 total regions tested
# Access different parts of the object
analysisTable(mock_results)
#> logFC P.Value B gene_name
#> chr1:1-100 2.0 0.01 4 GeneA
#> chr1:101-200 -2.0 0.01 3 GeneB
#> chr1:201-300 0.1 0.90 -1 GeneC
enrichedCond1(mock_results)
#> logFC P.Value B gene_name
#> chr1:1-100 2 0.01 4 GeneA
conditionNames(mock_results)
#> Condition 1 Condition 2
#> "C1" "C2"