singleMarkerRegression: Run a single marker regression using marker dosages

Description Usage Arguments Value Examples

View source: R/polyqtlR_functions.R

Description

Function to run a single marker regression using marker dosages

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
singleMarkerRegression(
  dosage_matrix,
  Phenotype.df,
  genotype.ID,
  trait.ID,
  maplist = NULL,
  perm_test = FALSE,
  N_perm = 1000,
  alpha = 0.05,
  ncores = 1,
  return_R2 = FALSE,
  log = NULL
)

Arguments

dosage_matrix

An integer matrix with markers in rows and individuals in columns. All markers in this matrix will be tested for association with the trait.

Phenotype.df

A data.frame containing phenotypic values

genotype.ID

The colname of Phenotype.df that contains the population identifiers (F1 names) (must be a colname of Phenotype.df)

trait.ID

The colname of Phenotype.df that contains the response variable to use in the model (must be a colname of Phenotype.df)

maplist

Option to include linkage map in the format returned by MDSMap_from_list from polymapR. If maplist is not specified (by default NULL) then no ordering of markers from dosage-matrix is performed. Note that all markers in dosage_matrix are tested; markers with dosages that were not on the maplist will be assigned unordered to linkage group 0 with dummy cM positions 1,2,3 etc.

perm_test

Logical, by default FALSE. If TRUE, a permutation test will be performed to determine a genome-wide significance threshold.

N_perm

Integer. The number of permutations to run if perm_test is TRUE; by default this is 1000.

alpha

Numeric. The P-value to be used in the selection of a threshold if perm_test is TRUE; by default 0.05 (i.e. the 0.95 quantile).

ncores

Number of cores to use if parallel processing required. Works both for Windows and UNIX (using doParallel). Use parallel::detectCores() to find out how many cores you have available.

return_R2

Should the (adjusted) R2 of the model fit also be determined?

log

Character string specifying the log filename to which standard output should be written. If NULL log is send to stdout.

Value

A list containing the following components:

Examples

1
2
3
data("SNP_dosages.4x","BLUEs.pheno")
Trait_1.smr <- singleMarkerRegression(dosage_matrix = SNP_dosages.4x,
Phenotype.df = BLUEs.pheno,genotype.ID = "Geno",trait.ID = "BLUE")

polyqtlR documentation built on Feb. 2, 2022, 5:09 p.m.