CallCandidates: Call candidate m6A regions or candidate differential m6A...

View source: R/CallCandidates.R

CallCandidatesR Documentation

Call candidate m6A regions or candidate differential m6A regions.

Description

This function first calls m6A bumps from each pair of input and IP sample using bin-level data. Then, bumps from all input and IP pairs are unioned together to obtain a list of candidate regions.

Usage

CallCandidates(Counts, bins,
               WhichThreshold ="fdr_lfc", pval.cutoff = 1e-5,
               fdr.cutoff = 0.05, lfc.cutoff = 0.7,
               windlen = 5,lowcount = 30)

Arguments

Counts

A data matrix containing bin-level (default 50bp) read counts in both IP and input samples, where the sample order is: input1, ip1, input2, ip2, ...

bins

A data frame containing the genomic coordinate of each bin of fixed length.

WhichThreshold

A character specifying a criterion to select significant bins in bump finding using an ad hoc algorithm. There are five options: "pval" (only use p-values), "fdr" (only use FDR), "lfc" (only use log fold change), "pval_lfc" (use both p-values and log fold changes) and "fdr_lfc" (use FDR and log fold changes). Default is "fdr_lfc".

pval.cutoff

A constant indicating the cutoff for p-value. Default is 1e-05.

fdr.cutoff

A constant indicating the cutoff for FDR. Default is 0.05.

lfc.cutoff

A constant indicating the cutoff for log fold change. Default is 0.7 for fold change of 2.

windlen

An integer specifying the length of consecutive bins used in simple moving average smooth of log fold change. Default is 5.

lowcount

An integer to filter out candidate regions with lower read counts in input. Default is 30.

Details

The function involves three steps:

  • Perform binomial test for each bin based bin-level counts

  • Merge significant bins in each input \& IP pair to form bumps usng: findBumps

  • Combine bumps from all input \& IP pairs to construct a list of candidate regions.

Value

A list containing

Regions

A data frame containng genomic coordinate for each candidate region.

Counts

A data matrix containing read counts of all samples for each candidate region.

Examples

### A toy example, whose results do not have real applications.
data("Basal")
Candidates = CallCandidates(
    Counts = Basal$Bins$Counts,
    bins = Basal$Bins$Bins
    )

ZhenxingGuo0015/TRESS documentation built on April 14, 2023, 4:21 p.m.