pairwise.cor.snp.scan: Calculate the r^2 (squared correlation coefficient) between...

View source: R/snp_r2.R

pairwise.cor.snp.scanR Documentation

Calculate the r^2 (squared correlation coefficient) between the genotype at all loci on a chromosome and a specified SNP marker.

Description

This function primarily takes a formula, data frame, genome cache, and directory of founder strain .alleles files to calculate the pairwise r^2 between all individual markers and a specified locus, likely the peak SNP.

Usage

pairwise.cor.snp.scan(
  data,
  formula,
  K,
  genomecache,
  model = c("additive", "full"),
  chr,
  point.locus,
  just.these.loci = NULL,
  print.progress = FALSE,
  exclusion.freq = .Machine$double.eps,
  X.list,
  ...
)

Arguments

data

A data frame with outcome and potential covariates. Should also have individual IDs that link to IDs in the genome cache with a column named "SUBJECT.NAME".

formula

An lm style formula with functions of outcome and covariates contained in data frame.

K

DEFAULT: NULL. A positive semi-definite relationship matrix, usually a realized genetic relationship matrix (GRM) based on SNP genotypes or the founder haplotype probabilities. Colnames and rownames should match the SUBJECT.NAME column in the data frame. If no K matrix is specified, either lmer is used (if sparse random effects are included in the formula) or a fixed effect model (equivalent to lm).

genomecache

The path to the genome cache directory. The genome cache is a particularly structured directory that stores the haplotype probabilities/dosages at each locus. It has an additive model subdirectory and a full model subdirectory. Each contains subdirectories for each chromosome, which then store .RData files for the probabilities/dosages of each locus.

model

DEFAULT: additive. Specifies how to model the founder haplotype probabilities. The additive options specifies use of SNP dosages, and is most commonly used. The full option regresses the phenotype on the actual genotype probabilities.

chr

Specifies which individual chromosomes to scan.

point.locus

The locus to calculate all pairwise r^2 between other loci on the chromosome. Often the peak SNP from a scan.

just.these.loci

DEFAULT: NULL. Specifies a reduced set of loci to fit.

print.progress

DEFAULT: FALSE. If TRUE, prints out how many loci have been fit currently.

exclusion.freq

DEFAULT: .Machine$double.eps. Loci with observed minor allele frequencies beneath the specified value are removed from the scan.

X.list

This specifies the SNP-based design matrices for all the loci. If a scan of the same population with the same markers has been performed, this option can save a lot of time.

Examples

pairwise.cor.snp.scan()

gkeele/miqtl documentation built on June 13, 2022, 4:20 p.m.