getPeakCounts0: Get read counts from IP and Input bam file with given peak...

View source: R/main.R

getPeakCounts0R Documentation

Get read counts from IP and Input bam file with given peak regions. To remove the backgroup noise, compute the scale factor between the IP and input read counts from the non-peak regions by by (All IP reads - reads of IP peaks regions ) / (All Input reads - reads of Input peaks regions) The final read count of peak region are reads of IP peak regions - scale factor * reads of input peak region

Description

Get read counts from IP and Input bam file with given peak regions. To remove the backgroup noise, compute the scale factor between the IP and input read counts from the non-peak regions by by (All IP reads - reads of IP peaks regions ) / (All Input reads - reads of Input peaks regions) The final read count of peak region are reads of IP peak regions - scale factor * reads of input peak region

Usage

getPeakCounts0(
  pr,
  ps,
  bamIP,
  bamInput = NULL,
  removedup = TRUE,
  fragment = 300,
  scaleControl = TRUE,
  libsize = c(1e+06, 1e+06),
  removeBackground = TRUE,
  paired.end = c("ignore", "filter")
)

Arguments

pr

GRanges objects, common or merged peak coordinates between two conditions

ps

GRanges objects, raw peak coordinates for the IP sample, if it is null

bamIP

string IP bam file path

bamInput

string Input bam file path, if it is null, do scale based on IP only

removedup

logical default is true to remove duplicates reads.

fragment

integer default is NULL, the fragment length will be determined by SGSeq::getBamInfo(). User can set it as 0, to avoid shift the reads.

scaleControl

logical default is TRUE, do scale for read counts

removeBackground

logical default is TRUE, remove background read count from each sample; For IP and Input, the IP will

paired.end

c("ignore", "filter"), refer to bamsignals-methods bamsignals ignore is used for single end reads, filter is used for paired end reads If paired.end="filter" then only first reads in proper mapped pairs will be considered (SAMFLAG 66, i.e. in the flag of the read, the bits in the mask 66 must be all ones).

libszie

integer vector corresponding to IP and Input libsize.

Value

list - count integer vector for each peak region - peakPos GRanges objects, common peak coordinates between two conditions - cIP integer read counts of IP sample - cInput integer read counts of input sample

Examples

readL = getPeakCounts(pr, bamIP, bamInput,removedup=TRUE, fragment = 300,
                         scaleControl=TRUE, libsize=c(1e6,1e6))


yancychy/DiffChIPL documentation built on Dec. 24, 2024, 11:26 p.m.