marker2covar: Creates a covariate from a genetic marker

Description Usage Arguments Value See Also Examples

View source: R/marker2covar.R

Description

Occasionally, researchers may want to condition marker effects on another genetic marker. For example, the HLA locus in humans has very strong effects on immune phenotypes, and can swamp smaller effects from other markers. It can be helpful to condition on markers in the HLA region to find genetic modifiers of these markers.

Usage

1
2
3
4
5
6
7
marker2covar(
  data_obj,
  geno_obj,
  singlescan_obj = NULL,
  covar_thresh = NULL,
  markers = NULL
)

Arguments

data_obj

a Cape object

geno_obj

a genotype object

singlescan_obj

It is possible to automatically identify markers to use as covariates based on their large main effects. If this is desired, a singlescan object is required.

covar_thresh

If designating markers as covariates based on their main effect size is desired, the covar_thresh indicates the main effect size above which a marker is designated as a covariate.

markers

Marker covariates can also be designated manually. markers takes in a vector of marker names or numbers and assigns the designated markers as covariates.

Value

This function returns the data object with additional information specifying which markers are to be used as covariates. this information can be retrieved with get_covar.

See Also

get_covar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
#convert markers with effect sizes greater than 6 to covariates.
#this requires a singlescan_obj
data_obj <- marker2covar(data_obj, geno_obj, singlescan_obj, covar_thresh = 6)

#convert the first marker to a covariate
#this does not require a singlescan_obj
marker_name <- dimnames(geno_obj)[[3]][1]
data_obj <- marker2covar(data_obj, geno_obj, markers = marker_name)

## End(Not run)

cape documentation built on Feb. 10, 2021, 5:06 p.m.