getcounts: Make a count matrix

Description Usage Arguments Value

Description

Make a count matrix from a GRanges object and a list of bam files

Usage

1
2
getcounts(regions, bamtab, binsize = 200, repFun = defaultRepFun,
  nthreads = 1)

Arguments

regions

GRanges object containing the genomic regions of interest. Each region will be divided into non-overlapping bins of equal size. The reads falling in each bin will be the elements of the final count matrix.

bamtab

Data frame describing how to get the counts from each file. The following columns are required: 'mark' (name of the histone mark), 'path' (path to the bam file). The following columns are optional: 'mapq' (minimum mapping quality), 'shift' (shift in the 3' to 5' direction applied to each read), 'pairedend' (paired end mode or not)

binsize

The size of each bin in basepairs. Each region must have a width multiple of binsize, otherwise an error will be thrown. Use the function refineRegions to make sure that your GRanges object satisfies this constraint.

repFun

In case there are replicate experiments (i.e. entries in bampath with the same 'mark' name), they will be collapsed into one experiment using this function. This function takes a matrix of counts as input where the columns are different experiments and the rows are different bins and returns a vector with as many elements as the rows of the input matrix.

nthreads

Number of threads. Parallelization is done on the histone marks using mclapply.

Value

A count matrix where the rows are the different marks labelled with the names of the list marks, and the columns are the different bins in the regions.


lamortenera/epicseg documentation built on May 20, 2019, 7:34 p.m.