loessByCluster: Apply loess smoothing to values within each spatially-defined...

View source: R/smooth.R

loessByClusterR Documentation

Apply loess smoothing to values within each spatially-defined cluster.

Description

Loess smoothing is applied independently to each cluster of genomic locations. Locations within the same cluster are close together to warrant smoothing across neighbouring locations.

Usage

loessByCluster(y, x = NULL, cluster, weights = NULL, bpSpan = 1000,
               minNum = 7, minInSpan = 5, maxSpan = 1, verbose = TRUE)

Arguments

y

A vector or matrix of values to be smoothed. If a matrix, each column represents a sample.

x

The genomic location of the values in y

cluster

A vector indicating clusters of locations. A cluster is typically defined as a region that is small enough that it makes sense to smooth across neighbouring locations. Smoothing will only be applied within a cluster, not across locations from different clusters.

weights

weights used by the loess smoother

bpSpan

The span used when loess smoothing. (Expressed in base pairs.)

minNum

Clusters with fewer than minNum locations will not be smoothed

minInSpan

Only smooth the region if there are at least this many locations in the span.

maxSpan

The maximum span. Spans greater than this value will be capped.

verbose

Boolean. Should progress be reported?

Details

This function is typically called by smoother, which is in turn called by bumphunter.

Value

fitted

The smoothed data values

smoothed

A boolean vector indicating whether a given position was smoothed

smoother

always set to ‘loess’.

Author(s)

Rafael A. Irizarry

See Also

smoother, runmedByCluster, locfitByCluster

Examples

dat <- dummyData()
smoothed <- loessByCluster(y=dat$mat[,1], cluster=dat$cluster, bpSpan = 1000,
                         minNum=7, minInSpan=5, maxSpan=1)

rafalab/bumphunter documentation built on March 20, 2024, 6:22 a.m.