Learn R Programming

DChIPRep (version 1.2.3)

summarizeCountsPerPosition: Helper function to summarize the counts per position

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

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.

Value

a vector containing the summarized counts per condition

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab