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

View source: R/main.R

getReadCountR 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 bam file must be indexed. The final read count of peak region are reads of IP peak regions - scale factor * reads of input peak region User can also ignore input samples in the configuration files.

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 bam file must be indexed. The final read count of peak region are reads of IP peak regions - scale factor * reads of input peak region User can also ignore input samples in the configuration files.

Usage

getReadCount(
  inputF,
  overlap = FALSE,
  comPeakFile = NULL,
  fragment = 0,
  removeBackground = TRUE,
  removedup = TRUE,
  nCore = 1
)

Arguments

inputF

file path, the file format is same to DiffBind input file to show the sample name, TF, Control, Treatment, bam file path, and peak files path. #contrast string vector, c(treatmentName, controlName)

overlap

logic default false, use union of the peaks, TRUE, use overlapped peaks

comPeakFile

string default NULL, the path of specified peak bed files. If it is not null, @overlap parameters will no be used.

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.

removeBackground

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

removedup

logic default true, remove duplicates

Value

list - countAll integer matrix, Read count of each sample after removing the background noise - peakPos GRanges objects, common peak coordinates between two conditions - fd data frame sample information - rawcount integer matrix read counts of input and IP sample

Examples

readL = getReadCounts(inputF, contrast = c(treatmentName, controlName), peakLen=2,fragment=300)


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