This function takes as input individual phenotype and genotype data for a given feature-SNP pair and tests for marginal and response QTLs.
map_qtl_for_each(
input,
feat.id = NULL,
snp.id = NULL,
fn,
scale = FALSE,
rint = FALSE,
tu.lambda = NULL,
type = "response",
seed = 1,
epsilon = 0.01,
control = NULL,
gls = FALSE
)A list containing phenotype, genotype, treatment, and subject. The elements must be named "y", "g", "t", and "subject".
A character string specifying the feature name.
A character string specifying the SNP name.
A character string specifying the function. This must be one of "nonlinear" and "linear", corresponding to nonlinear and linear models, respectively.
A logical scalar as to whether to standardize the
phenotype, y. This can be set to TRUE only if
fn is set to "linear".
A logical scalar as to whether the phenotypes need to be
RINT-transformed. This cannot be set to TRUE if fn
is set to "nonlinear".
A list obtained from
get_eigen. It must contain the transposed
eigenvector matrix and the eigenvalues of the covariance
matrix. The element names must be "tU" and "lambda".
A character string specifying the type of QTLs. This
must be one of "marginal" and "response".
An integer specifying a seed for RNG.
A small positive scalar. The upper bound of the
\(h^2\) search interval is set to \(1 - \epsilon\). Default
is 1e-2. Ignored when ranef is FALSE.
A list of control parameters passed to
optim for the inner BFGS step. If
NULL, the defaults are used. Ignored when
gls = TRUE.
A logical scalar. If TRUE, use the closed-form
generalized least squares (GLS) estimator instead of BFGS.
Only valid when fn is "linear". Default is
FALSE.
A list containing some of the following elements:
feat_id - A character string specifying the feature ID.
snp_id - A character string specifying the SNP ID.
beta0 - A scalar value representing the intercept
estimate.
beta_g - A scalar value representing the genotype
effect estimate based on the marginal model (when
type = "marginal") or the interaction model (when
type = "response").
beta_t - A scalar value representing the treatment
effect estimate based on the interaction model.
beta_gxt - A scalar value representing the interaction
effect estimate based on the interaction model.
sigma - A scalar value representing the estimate of
the residual error standard deviation.
sigma_u - A scalar value representing the estimate of
the random effect standard deviation.
p_value - A scalar value representing the nominal
p-value from LRT.
return_code - An integer: 0 if all optimizations
converged, NA otherwise.