Description Usage Arguments Details Value Author(s) References See Also Examples
Performs background correction using the normal-gamma model.
1 2 |
x |
vector of observed intensities. |
par |
vector of parameters; |
tail.cor |
logical (see details). |
cor |
limit of the right tail correction (see details). |
gshift |
logical; if |
mu, sigma |
alternative definition of mean and standard deviation of the normal distribution. |
k, theta |
alternative definition of shape and scale parameters of the gamma distribution. |
normgam.signal
performs background correction in an additive background noise+signal model with a normal background noise and a gamma-distributed signal. The corrected value from an observed intensity x
is the expectation of the signal given the signal and noise distributions. For a set of parameters (mu, sigma, k, theta)
, it is given by the ratio of the convolution product of dgamma(x, shape=k+1, scale=theta)
and dnorm(x, mean=mu, sd=sigma)
and the convolution product of dgamma(x, shape=k, scale=theta)
and dnorm(x, mean=mu, sd=sigma)
. For more details see Plancade S., Rozenholc Y. and Lund E., BMC Bioinfo 2012.
If tail.cor = TRUE
, a linear approximation of right tail is applied to values with density estimate smaller than cor
in the computation of normal-gamma convoluted densities (see dnormgam
).
Only one definition of the parameters is required, either par
or (mu, sigma, k, theta)
. If both are specified and do not match, an error message is returned.
Vector of background noise-corrected intensities.
Plancade S. and Rozenholc Y.
Plancade S., Rozenholc Y. and Lund E. "Generalization of the normal-exponential model : exploration of a more accurate parametrisation for the signal distribution on Illumina BeadArrays", BMC Bioinfo 2012, 13(329).
dnormgam
computes the density of the normal-gamma distribution and normgam.fit
computes the Maximum Likelihood Estimator. Intensities
provides an example of Illumina microarray data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #Example 1: simulated data
n = 50000
par = c(60,5,0.15,400)
S = rgamma(n, shape=par[3], scale=par[4])
B = rnorm(n, mean=par[1], sd=par[2])
X = S + B
par(mfrow=c(2,1))
Shat1 = normgam.signal(X, par)
H1 = histogram(Shat1, type='irregular', verbose=FALSE, plot=FALSE)
plot(H1, xlim=c(0,50))
I = seq(from=0, to=50, length=1000)
lines(I, dgamma(I, shape=0.15, scale=400), col='red')
Shat2 = normgam.signal(X, par, gshift = TRUE)
H2 = hist(Shat2, 10000, plot=FALSE)
plot(H2, xlim=c(0,50), freq=FALSE)
lines(I, dgamma(I, shape=0.15, scale=400), col='red')
#Example 2: Illumina data
## Not run:
data(RegNegIntensities_Example)
X = Intensities$Regular
N = Intensities$Negative
# parameter estimation
parmle = normgam.fit(X, N)$par
Shat = normgam.signal(X,parmle)
H = histogram(Shat, type='irregular', verbose=FALSE, plot=FALSE)
plot(H, xlim=c(0,30))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.