SNPgvf {FunctanSNP} | R Documentation |
Transform the sequence (genotypes) data into the genetic variant function
Description
This function conducts the ordinary linear square smoothing analysis and models the genotypes of an individual (such as the sequence data generated by simX containing only 0, 1, 2) as the genetic variant function X(t).
Usage
SNPgvf(location, X, type, nbasis, params, Plot = FALSE)
Arguments
location |
a numeric vector defining the sampling sites of the sequence data. |
X |
a matrix specifyinging the sequence data, with the number of rows equal to the number of samples. |
type |
a character specifying the type of the basis functions. The options are "Bspline", "Exponential", "Fourier", "Monomial", and "Power". |
nbasis |
an integer specifying the number of basis functions. |
params |
in addition to rangeval (a vector of length 2 giving the lower and upper limits of the range of permissible values for the function) and nbasis, all bases have one or two parameters unique to that basis type or shared with one other:
|
Plot |
should the estimated genetic variant function X(t) be plotted (TRUE) or not (default = FALSE). |
Value
An 'fd' object that contains the estimated genetic variant function.
See Also
See Also as simX
, plotRawdata
.
Examples
library(FunctanSNP)
n <- 20
m <- 50
simdata <- simX(n, m, seed = 1, d.ratio = 0)
X <- simdata$X
location <- simdata$location
SNPgvfres <- SNPgvf(location, X, type = "Bspline", nbasis = 5, params = 4, Plot = FALSE)
plotRawdata(location, X)
plotGVF(SNPgvfres)