FBN.histogramMaxima {FBN} | R Documentation |
Local maxima of the histogram of SNP microarray data
Description
Finds at most 6 of the local maxima of the histogram of the inputData
representing the SNP microarray data.
Firstly, the function finds all local maxima onto the histogram,
and finally removes those that are closer than minSpan
.
The histogram is estimated with equi-spaced breaks (also the default),
defined by breaksData
(see the documentation of hist
for more details).
Usage
FBN.histogramMaxima(inputData, minSpan, breaksData)
FBN.histogramMaxima(inputData, minSpan = 0.2, breaksData = NULL)
Arguments
inputData |
A vector of SNP microarray values for which the local maxima of the histogram are desired |
minSpan |
The minimum distance separating consecutive local maxima. If |
breaksData |
One of:
|
Details
This function has been designed based on SNP microarray data and FISH resolution. As in FISH analyses high numbers of signals do not allow a correct identification of discrete CNs, an empirical number of no more than 6 local maxima is therefore imposed. These maxima are used to initialize the k-means algorithm to determine the CN clusters.
Value
Returns a vector containing at most 6 values of the inputData
in which the histogram shows local maxima.
Author(s)
Adrian Andronache adi.andronache@gmail.com
Luca Agnelli luca.agnelli@gmail.com
See Also
Examples
require(stats)
require(graphics)
x = c(rnorm(1000, 1, .2), rnorm(1000, 2, .2))
y = FBN.histogramMaxima(x, minSpan = .1)
h = hist(x)
par(new = TRUE)
plot(y,vector(mode=mode(y), length = length(y)), xlim = c(min(h$breaks),
max(h$breaks)), ylim = c(0,max(h$counts)), xlab = NA, ylab = NA,
col = 'red' )
x = c(1, 2, 2, 3, 4, 5, 5, 5, 6, 7, 8, 9, 10, 10, 10, 11)
y = FBN.histogramMaxima(x, minSpan = 3, breaksData = 100)
h = hist(x, 100)
par(new = TRUE)
plot(y,vector(mode=mode(y), length = length(y)), xlim = c(min(h$breaks),
max(h$breaks)), ylim = c(0,max(h$counts)), xlab = NA, ylab = NA,
col = 'red' )