fisherUMI4C: Differential UMI4C contacts using Fisher's Exact test

View source: R/differentialFisherUMI4C.R

fisherUMI4CR Documentation

Differential UMI4C contacts using Fisher's Exact test

Description

Using the UMIs inside query_regions performs Fisher's Exact test to calculate significant differences between contact intensities.

Usage

fisherUMI4C(
  umi4c,
  grouping = "condition",
  query_regions,
  resize = NULL,
  window_size = 5000,
  filter_low = 50,
  padj_method = "fdr",
  padj_threshold = 0.05
)

Arguments

umi4c

UMI4C object as generated by makeUMI4C or the UMI4C constructor.

grouping

Name of the column in colData used to merge the samples or replicates. If none available or want to add new groupings, run addGrouping. Default: "condition".

query_regions

GenomicRanges object or data.frame containing the region coordinates used to perform the differential analysis.

resize

Width in base pairs for resizing the query_regions. Default: no resizing.

window_size

If query_regions are not defined, wil bin region in window_size bp and perform the analysis using this windows.

filter_low

Either the minimum median UMIs requiered to perform Fisher's Exact test or FALSE for performing the test in all windows.

padj_method

Method for adjusting p-values. See p.adjust for the different methods.

padj_threshold

Numeric indicating the adjusted p-value threshold to use to define significant differential contacts.

Details

This function calculates the overlap of fragment ends with either the provided query_regions or the binned region using window_size. The resulting number of UMIs in each query_region will be the sum of UMIs in all overlapping fragment ends. As a default, will filter out those regions whose median UMIs are lower than filter_low.

Finally, a contingency table for each query_reegions or window that passed the filter_low filter is created as follows:

query_region region
Reference n1 N1-n1
Condition n2 N2-n2

and the Fisher's Exact test is performed. Obtained p-values are then converted to adjusted p-values using padj_method and the results list is added to the UMI4C object.

Value

Calculates statistical differences between UMI-4C experiments.

Examples

data("ex_ciita_umi4c")
ex_ciita_umi4c <- addGrouping(ex_ciita_umi4c, grouping="condition")

# Perform differential test
enh <- GRanges(c("chr16:10925006-10928900", "chr16:11102721-11103700"))
umi_dif <- fisherUMI4C(ex_ciita_umi4c, query_regions = enh, 
                       filter_low = 20, resize = 5e3)
resultsUMI4C(umi_dif)                        

Pasquali-lab/UMI4Cats documentation built on March 23, 2024, 9:42 p.m.