sliding_meansd: Compute mean and standard deviation of scores in a sliding...

Description Usage Arguments Value Author(s) See Also Examples

Description

This functions is used to slide a window of specified size over scores at given positions. Computed is the mean and standard deviation over the scores in the window.

Usage

1
sliding.meansd(positions, scores, half.width)

Arguments

positions

numeric; sorted vector of (genomic) positions of scores

scores

numeric; scores to be smoothed associated to the positions

half.width

numeric, half the window size of the sliding window

Value

Matrix with three columns:

mean

means over scores in running window centered at the positions that were specified in argument positions.

sd

standard deviations over scores in running window centered at the positions that were specified in argument positions.

count

number of points that were considered for computing the mean and standard deviation at each position

Author(s)

Joern Toedling and Oleg Sklyar

See Also

sliding.quantile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
   set.seed(123)
   sampleSize <- 10
   ap <- cumsum(1+round(runif(sampleSize)*10))
   as <- c(rnorm(floor(sampleSize/3)),
           rnorm(ceiling(sampleSize/3),mean=1.5),
           rnorm(floor(sampleSize/3)))
   sliding.meansd(ap, as, 20)
   ap
   mean(as[1:3])
   sd(as[1:3])

Ringo documentation built on Nov. 8, 2020, 5:34 p.m.