featureDensity: Computing density for a given feature

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/nucSim.R

Description

This set of functions is used to generate the density of individual features of different types. featureDensity is an S3 generic, functions may be defined for different feature classes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
featureDensity(x, ...)
## S3 method for class 'StableFeature'
featureDensity(x, stable=stableDens, background=FALSE, ...)
## S3 method for class 'StablePhasedFeature'
featureDensity(x, stable=stableDens, dist=distDens, background=FALSE, ...)
## S3 method for class 'ReversePhasedFeature'
featureDensity(x, stable=stableDens, dist=distDens, background=FALSE, ...)
## S3 method for class 'NFRFeature'
featureDensity(x, background=FALSE, ...)
## S3 method for class 'FuzzyFeature'
featureDensity(x, ...)

Arguments

x

The feature for which the density should be computed.

stable

Function that should be used to compute the density of a stable feature.

dist

Function that should be used to compute the distribution of distances between adjacent features.

background

Logical indicating whether uniform background should be added to the feature.

...

Arguments to future functions.

Details

These functions are used internally by feat2dens. There should be no need to call them directly but it is important to supply suitable featureDensity functions for new feature types.

Value

A two column matrix. The first column contains the density, the second the weight at each position.

Author(s)

Peter Humburg

See Also

feat2dens, makeFeatures

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Create a single StableFeature
feature <- stableFeature(start = 200, weight = 0.8, shift = 10, 
	stability = 1, ratio = 1)

## Convert the feature into a density (without background)
featDens <- featureDensity(feature)

## If we want featureDensity to automatically add uniform background
## we have to ensure that the feature has a 'meanDist' parameter
## (this is usually added by 'reconcileFeatures').
feature$meanDist <- 200
featDens2 <- featureDensity(feature, background = TRUE)

ChIPsim documentation built on Nov. 8, 2020, 8:09 p.m.