R/differentialFisherUMI4C.R
fisherUMI4C.Rd
Using the UMIs inside query_regions
performs Fisher's Exact test to
calculate significant differences between contact intensities.
fisherUMI4C( umi4c, grouping = "condition", query_regions, resize = NULL, window_size = 5000, filter_low = 50, padj_method = "fdr", padj_threshold = 0.05 )
umi4c | UMI4C object as generated by |
---|---|
grouping | Name of the column in colData used to merge the samples or
replicates. If none available or want to add new groupings, run
|
query_regions |
|
resize | Width in base pairs for resizing the |
window_size | If |
filter_low | Either the minimum median UMIs requiered to perform
Fisher's Exact test or |
padj_method | Method for adjusting p-values. See
|
padj_threshold | Numeric indicating the adjusted p-value threshold to use to define significant differential contacts. |
Calculates statistical differences between UMI-4C experiments.
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.
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)#> GRanges object with 2 ranges and 6 metadata columns: #> seqnames ranges strand | id pvalue odds_ratio #> <Rle> <IRanges> <Rle> | <character> <numeric> <numeric> #> [1] chr16 10924453-10929452 * | region_1 1.28944e-05 2.55569 #> [2] chr16 11100711-11105710 * | region_2 NA NA #> log2_odds_ratio padj sign #> <numeric> <numeric> <logical> #> [1] 1.35371 1.28944e-05 TRUE #> [2] NA NA <NA> #> ------- #> seqinfo: 1 sequence from an unspecified genome; no seqlengths