create_snpinfo: Create snp information table for a cross

Description Usage Arguments Value See Also Examples

View source: R/create_snpinfo.R

Description

Create a table of snp information from a cross, for use with scan1snps().

Usage

1

Arguments

cross

Object of class "cross2". For details, see the R/qtl2 developer guide.

Value

A data frame of SNP information with the following columns:

See Also

index_snps(), scan1snps(), genoprob_to_snpprob()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
# load example data and calculate genotype probabilities
file <- paste0("https://raw.githubusercontent.com/rqtl/",
               "qtl2data/main/DO_Recla/recla.zip")
recla <- read_cross2(file)
snpinfo <- create_snpinfo(recla)

# calculate genotype probabilities
pr <- calc_genoprob(recla, error_prob=0.002, map_function="c-f")

# index the snp information
snpinfo <- index_snps(recla$pmap, snpinfo)

# sex covariate
sex <- setNames((recla$covar$Sex=="female")*1, rownames(recla$covar))

# perform a SNP scan
out <- scan1snps(pr, recla$pmap, recla$pheno[,"bw"], addcovar=sex, snpinfo=snpinfo)

# plot the LOD scores
plot(out$lod, snpinfo, altcol="green3")

## End(Not run)

qtl2 documentation built on Oct. 18, 2021, 1:06 a.m.