summarizeCountsPerPosition {DChIPRep} | R Documentation

## 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.

### 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

    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)

[Package DChIPRep version 1.14.0 Index]