applyOverlap {IntEREst} | R Documentation

## Apply function over counts

### Description

Runs a function on columns of the counts (assay) of a 'SummarizedExperiment' object (resulted by `interest()`, `interest.sequential()` or `readInterestResults()` ) based on the overalp of its exon/intron coordinates with those of another 'SummarizedExperiment' object. The number of the rows and the dimensions of the counts of the result are equal to those of the `subject`. The function is applied on the query based on it's overlap to the subject.

### Usage

    applyOverlap(
    	query,
    	subject,
    	type="any",
    	replaceValues=FALSE,
    	intExCol="int_ex",
    	intronExon="intron",
    	sujectGeneNamesCol,
    	repeatsTableToFilter=c(),
    	scaleFragment=TRUE,
    	scaleLength=TRUE,
    	unmapValue=0,
    	FUN=mean,
    	...
    )

### Arguments

`query, subject` | SummarizedExperiment objects resulted by `interest()`, `interest.sequential()` or `readInterestResults()` functions.
`type` | The type of overlap. By default it considers any overlap. See findOverlaps for more info.
`replaceValues` | Whether return a 'SummarizedExperiment' object with new counts (resulted by running function) replaced.
`intExCol` | Column name (or number) in the rowData of the objects that represents whether each row of the assay is "intron" or "exon".
`intronExon` | Should be assigned either `'intron'` or `'exon'` or `c('intron','exon')` based on whether match the PWM to the intronic, exonic, or intronic and exonic regions of the reference. By default it seeks matches in intronic regions (intronExon='intron').
`sujectGeneNamesCol` | The column in the row data of the subject that includes the gene names.
`repeatsTableToFilter` | A data.frame table that includes chr,begin and end columns. If defined, all reads mapped to the described regions will be ingnored.
`scaleFragment` | Logical value, indicating whether the retention levels must be scaled by (genewide) fragment levels.
`scaleLength` | Logical value, indicating whether the retention levels must be scaled by length of the introns/exons.
`unmapValue` | The value to assign to unmapped rows (i.e. introns/exons).
`FUN` | The function to apply.
`...` | Other parameter settings from `aggregate()` function.

### Value

The returned value is a data frame if `replaceValues` is FALSE and it is SummarizedExperiment if `replaceValues` is TRUE.

### Author(s)

Ali Oghabian

### See Also

`readInterestResults` `interest` `interest.sequential`

### Examples

    mdsChr22Obj

    tmp<- applyOverlap(
    	query=mdsChr22Obj,
    	subject=mdsChr22Obj,
    	type="equal",
    	replaceValues=FALSE,
    	intExCol="int_ex",
    	intronExon="intron",
    	sujectGeneNamesCol="collapsed_transcripts",
    	scaleFragment=TRUE,
    	scaleLength=TRUE,
    	unmapValue=0,
    	FUN=head,
    	n=1
    )

[Package IntEREst version 1.10.2 Index]