summarizeCountsPerPosition: Helper function to summarize the counts per position

Description Usage Arguments Details Value Examples

View source: R/dataImport.R

Description

This function takes a matrix of counts, with the genomic features (e.g. transcripts or genes) in the rows and the positions upstream and downstream of the TSS in the columns and returns a vector with the summarized counts per position.

Usage

1
summarizeCountsPerPosition(mat, ct = 0, trim = 0.15)

Arguments

mat

the input matrix with positions in the columns and the genomic features in the rows.

ct

the count threshold to use.

trim

the trimming percentage for the trimmed mean.

Details

The summary per condition is computed as a trimmed mean per position. First, counts greater than ct are removed and then a trimmed mean with a trimming percentage of trim is computed on the log scale. This mean is then exponentiated again and multiplied by the total number of features passing the threshold ct per position. If a position contains only zero counts, its mean is returned as zero.

Value

a vector containing the summarized counts per condition

Examples

1
2
3
4
5
6
data(exampleSampleTable)
directory <- file.path(system.file("extdata", package="DChIPRep"))
df  <- lapply(file.path(directory, exampleSampleTable$Input), 
read.delim)[[1]]
mat <- getMATfromDataFrame(df)
summaryPerPos <- summarizeCountsPerPosition(mat)

DChIPRep documentation built on Nov. 17, 2017, 10:08 a.m.