normalize read coverage between samples

Description

The function normalizes coverage values between samples using a scaling factor derived from differences between mean or median of coverage distributions

Usage

1
2
3
4
5
6
7
8
9
normalizeCoverage(obj,method="median",chunk.size,save.db,...)

## S4 method for signature 'methylRawList'
normalizeCoverage(obj, method = "median",
  chunk.size = 1e+06, save.db = FALSE, ...)

## S4 method for signature 'methylRawListDB'
normalizeCoverage(obj, method = "median",
  chunk.size = 1e+06, save.db = TRUE, ...)

Arguments

obj

methylRawList or methylRawListDB object

method

a string "mean" or "median" which denotes median or mean should be used to calculate scaling factor. (Default:median)

chunk.size

Number of rows to be taken as a chunk for processing the methylRawListDB objects. (Default: 1e6)

save.db

A Logical to decide whether the resulting object should be saved as flat file database or not, default: explained in Details sections

...

optional Arguments used when save.db is TRUE

suffix A character string to append to the name of the output flat file database, only used if save.db is true, default actions: append “_filtered” to current filename if database already exists or generate new file with filename “sampleID_filtered”

dbdir The directory where flat file database(s) should be stored, defaults to getwd(), working directory for newly stored databases and to same directory for already existing database

Value

a methylRawList or methylRawList object depending on class of input object

Details

The parameter chunk.size is only used when working with methylRawListDB objects, as they are read in chunk by chunk to enable processing large-sized objects which are stored as flat file database. Per default the chunk.size is set to 1M rows, which should work for most systems. If you encounter memory problems or have a high amount of memory available feel free to adjust the chunk.size.

The parameter save.db is per default TRUE for methylDB objects as methylRawListDB, while being per default FALSE for methylRawList. If you wish to save the result of an in-memory-calculation as flat file database or if the size of the database allows the calculation in-memory, then you might want to change the value of this parameter.

Author(s)

Altuna Akalin

Examples

1
2
3
4
5
6
7
data(methylKit)
# normalize by the median coverage
newObj = normalizeCoverage(methylRawList.obj,method="median")

# normalize by mean coverage and save to database in folder methylDB
newDBObj = normalizeCoverage(methylRawList.obj,method="mean",
save.db=TRUE,dbdir="methylDB")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.