Skip to contents

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

analysis

A `data.frame` containing the full differential analysis table from `limma` or `NOISeq`.

upCond1

A `data.frame` of regions significantly enriched in the first condition.

upCond2

A `data.frame` of regions significantly enriched in the second condition.

cond

A named `character` vector mapping user-friendly display names (the names) to the internal condition identifiers (the values) used in the analysis.

data

A `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 (a data.frame).

  • enrichedCond1(object): Returns a data.frame of regions significantly enriched in the first condition.

  • enrichedCond2(object): Returns a data.frame of regions significantly enriched in the second condition.

  • conditionNames(object): Returns a named character vector mapping display names to internal identifiers.

  • inputData(object): Returns a list containing the original input data used for the analysis.

  • expressed(object, condition, fdr = 0.05, which = "any"): Returns a data.frame of genes considered expressed in `condition`, based on an FDR threshold of significantly enriched occupancy. Only available for analyses with FDR calculations, generated via load_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"