rpMatrix: Reads per million profile matrices for plotting

View source: R/count.R

rpMatrixR Documentation

Reads per million profile matrices for plotting

Description

This function fills the profile field in the main input argument in recoup function by calculating profile matrices using reads per million (rpm) or reads per kb per million reads (rpkm) over binned genomic areas of interest, instead of genomic coverage signals. The profile matrices are used for later plotting.

Usage

    rpMatrix(input, mainRanges, flank, binParams,
        strandedParams = list(strand = NULL, ignoreStrand = TRUE),
        rc = NULL)

Arguments

input

an input list as in recoup but with the ranges field of each member filled (e.g. after using preprocessRanges.

mainRanges

the genome from recoup as a GRanges object (e.g. the output from makeGRangesFromDataFrame).

flank

see the flank argument in the main recoup function.

binParams

see the binParams argument in the main recoup function.

strandedParams

see the strandedParams argument in the main recoup function.

rc

fraction (0-1) of cores to use in a multicore system. It defaults to NULL (no parallelization).

Details

Regarding the calculation of rpm and rpkm values, the calculations slightly differ from the default defintions of these measurements in the sense that they are also corrected for the bin lengths so as to acquire human-friendly values for plotting.

Note that the genomic ranges (BAM/BED files) must be imported before using this function (as per the default recoup pipeline). We plan to support streaming directly from BAM files in the future.

Value

Same as input with the profile fields filled.

Author(s)

Panagiotis Moulos

Examples

# Load some data
data("recoup_test_data",package="recoup")
# Do some work
testGenomeRanges <- makeGRangesFromDataFrame(df=test.genome,
    keep.extra.columns=TRUE)
w <- width(testGenomeRanges)
testGenomeRanges <- promoters(testGenomeRanges,upstream=2000,downstream=0)
testGenomeRanges <- resize(testGenomeRanges,width=w+4000)
test.input <- rpMatrix(
    test.input, 
    mainRanges=testGenomeRanges,
    flank=c(2000,2000),
    binParams=list(flankBinSize=50,regionBinSize=150,binType="fixed",
        sumStat="mean",interpolation="spline"),
    rc=0.1
)

pmoulos/recoup documentation built on May 20, 2024, 2:22 a.m.