scan1snps: Single-QTL genome scan at imputed SNPs

Description Usage Arguments Details Value See Also Examples

View source: R/scan1snps.R

Description

Perform a single-QTL scan across the genome or a defined region at SNPs genotyped in the founders, by Haley-Knott regression or a liear mixed model, with possible allowance for covariates.

Usage

1
2
3
4
5
scan1snps(genoprobs, map, pheno, kinship = NULL, addcovar = NULL,
  Xcovar = NULL, intcovar = NULL, weights = NULL, reml = TRUE,
  model = c("normal", "binary"), query_func = NULL, chr = NULL,
  start = NULL, end = NULL, snpinfo = NULL, batch_length = 20,
  keep_all_snps = FALSE, cores = 1, ...)

Arguments

genoprobs

Genotype probabilities as calculated by qtl2geno::calc_genoprob().

map

Physical map for the positions in the genoprobs object: A list of numeric vectors; each vector gives marker positions for a single chromosome.

pheno

A matrix of phenotypes, individuals x phenotypes.

kinship

Optional kinship matrix, or a list of kinship matrices (one per chromosome), in order to use the LOCO (leave one chromosome out) method.

addcovar

An optional matrix of additive covariates.

Xcovar

An optional matrix with additional additive covariates used for null hypothesis when scanning the X chromosome.

intcovar

An optional matrix of interactive covariates.

weights

An optional vector of positive weights for the individuals. As with the other inputs, it must have names for individual identifiers. Ignored if kinship is provided.

reml

If kinship provided: if reml=TRUE, use REML; otherwise maximum likelihood.

model

Indicates whether to use a normal model (least squares) or binary model (logistic regression) for the phenotype. If model="binary", the phenotypes must have values in [0, 1].

query_func

Function for querying SNP information; see R/qtl2db. Takes arguments chr, start, end, (with start and end in the units in map, generally Mbp), and returns a data frame containing the columns snp, chr, pos, and sdp. (See snpinfo below.)

chr

Chromosome or chromosomes to scan

start

Position defining the start of an interval to scan. Should be a single number, and if provided, chr should also have length 1.

end

Position defining the end of an interval to scan. Should be a single number, and if provided, chr should also have length 1.

snpinfo

Option data frame of SNPs to scan; if provided, query_func, chr, start, and end are ignored. Should contain the following columns:

  • chr - Character string or factor with chromosome

  • pos - Position (in same units as in the "map").

  • sdp - Strain distribution pattern: an integer, between 1 and 2^n - 2 where n is the number of strains, whose binary encoding indicates the founder genotypes

  • snp - Character string with SNP identifier (if missing, the rownames are used).

batch_length

Interval length (in units of map, generally Mbp) to scan at one time.

keep_all_snps

SNPs are grouped into equivalence classes based on position and founder genotypes; if keep_all_snps=FALSE, the return value will contain information only on the indexed SNPs (one per equivalence class).

cores

Number of CPU cores to use, for parallel calculations. (If 0, use parallel::detectCores().) Alternatively, this can be links to a set of cluster sockets, as produced by parallel::makeCluster().

...

Additional control parameters passed to scan1()

Details

The analysis proceeds as follows:

Value

A list with two components: lod (matrix of LOD scores) and snpinfo (a data frame of SNPs that were scanned, including columns index which indicates groups of equivalent SNPs)

See Also

scan1(), genoprob_to_snpprob(), index_snps(), R/qtl2db, plot_snpasso() in R/qtl2plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# load example data and calculate genotype probabilities
library(qtl2geno)
file <- paste0("https://raw.githubusercontent.com/rqtl/",
               "qtl2data/master/DOex/DOex.zip")
DOex <- read_cross2(file)
probs <- calc_genoprob(DOex, error_prob=0.002)

library(qtl2db)
snpdb_file <- system.file("extdata", "cc_variants_small.sqlite", package="qtl2db")
queryf <- create_variant_query_func(snpdb_file)

out <- scan1snps(probs, DOex$pmap, DOex$pheno, query_func=queryf, chr=2, start=97, end=98)

## End(Not run)

rqtl/qtl2scan documentation built on May 28, 2019, 2:36 a.m.