Usage
CodomMarker(y, ng = 5, mutype = 0, sdtype = "sd.const", ptype = "p.free", clus = TRUE, mu.start = NA, sd.start=rep(0.075,ng), sd.fixed = 0.075, p = NA, maxiter = 500, maxn.bin = 200, nbin = 200, plothist = TRUE, nbreaks = 40, maintitle = NULL, subtitle = NULL, xlabel = NULL, xaxis = "s")
Arguments
y
the vector of signal ratios (each value is from one sample, vector y contains the values for 1 marker). All values must be between 0 and 1 (inclusive), NAs are not allowed. The minimum length of y is 10*ng.
ng
the number of possible genotypes (mixture components) to be fitted: one more than the ploidy of the samples
mutype
an integer in 0:6. Describes how to fit the means of the components of the mixture model: with mutype=0 the means are not constrained, requiring ng degrees of freedom. With mutype in 1:6 the means are constrained based on the ng possible allele ratios according to one of 6 models; see Details.
sdtype
one of "sd.const", "sd.free", "sd.fixed". Describes how to fit the standard deviations of the components of the mixture model: with "sd.const" all standard deviations (on the transformed scale) are equal (requiring 1 degree of freedom); with "sd.free" all standard deviations are fitted separately (ng d.f.); with "sd.fixed" all sd's on the transformed scale are equal to parameter sd.fixed (0 d.f.).
ptype
one of "p.free", "p.fixed" or "p.HW". Describes how to fit the mixing proportions of the components of the mixture model: with "p.free", the proportions are not constrained (and require ng-1 degrees of freedom); with "p.fixed" the proportions given in parameter p are fixed; with "p.HW" the proportions are calculated from the overall allele frequency, requiring only 1 degree of freedom.
clus
boolean. If TRUE, the initial means and standard deviations are based on a kmeans clustering into ng groups. If false, the initial means are equally spaced on the transformed scale between the values corresponding to 0.02 and 0.98 on the original scale and the initial standard deviations are 0.075 on the transformed scale.
mu.start
vector of ng values. If present, gives the start values of mu (the means of the mixture components) on the original (untransformed) scale, must be strictly ascending (mu[i]>mu[i-1]). Overrides the start values determined by clus TRUE or FALSE.
sd.start
vector of ng values. If present, gives the start values of sd (the standard deviations of the mixture components) on the transformed scale. Overrides the start values determined by clus TRUE or FALSE.
sd.fixed
vector, recycled if less than ng values: if argument sdtype is "sd.fixed", argument sd.fixed specifies the fixed standard deviations.
p
a vector of ng elements with the initial (or fixed, if parameter ptype is "p.fixed") mixing proportions of the mixture model components.
maxiter
integer: the maximum number of times the nls function is called in CodomMarker (0 = no limit, default=500)
maxn.bin
integer, default=200: if the length of y is larger than max.nbin the values of y (after arcsine square root transformation) are binned (i.e. the range of y (0 to pi/2) is divided into nbin bins of equal width and the number of y values in each bin is used as the weight of the midpoints of each bin). This results in significant speed improvement with large numbers of samples without noticeable effects on model fitting.
nbin
integer, default=200: the number of bins(see maxn.bin)
plothist
If TRUE a histogram of y is plotted with the fitted distributions superimposed
nbreaks
number of breaks for plotting the histogram; does not have an effect on fitting the mixture model
maintitle
string, used for plotting
subtitle
string, used for plotting
xlabel
string, used for plotting
xaxis
string, used for plotting: if "n" no x-axis is plotted