/
tidy_scan_pvl.Rd
44 lines (42 loc) · 1.55 KB
/
tidy_scan_pvl.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tidy_scan_pvl.R
\name{tidy_scan_pvl}
\alias{tidy_scan_pvl}
\title{Tidy the data frame outputted by scan_pvl for further analysis & plotting}
\usage{
tidy_scan_pvl(mytib, pmap, phenames = c("trait1", "trait2"))
}
\arguments{
\item{mytib}{outputted tibble from scan_pvl}
\item{pmap}{physical map (in Mb) or genetic map (in cM) for exactly one chromosome}
\item{phenames}{vector of length 2 containing two trait names}
}
\description{
Tidy the data frame outputted by scan_pvl for further analysis & plotting
}
\examples{
# read data
iron <- qtl2::read_cross2(system.file("extdata", "iron.zip", package="qtl2"))
# insert pseudomarkers into map
map <- qtl2::insert_pseudomarkers(iron$gmap, step=1)
# calculate genotype probabilities
probs <- qtl2::calc_genoprob(iron, map, error_prob=0.002)
# grab phenotypes and covariates; ensure that covariates have names attribute
pheno <- iron$pheno
# leave-one-chromosome-out kinship matrices
kinship <- qtl2::calc_kinship(probs, "loco")$`1`
# get founder allele probabilites
probs <- qtl2::genoprob_to_alleleprob(probs)$`1`
ac <- matrix(as.numeric(iron$covar$sex == "m", ncol = 1))
colnames(ac) <- "sex"
rownames(ac) <- rownames(probs)
ss <- scan_pvl(probs = probs, pheno = pheno, kinship = kinship, addcovar = ac,
start_snp = 1, n_snp = 80, n_cores = 1)
tidy_scan_pvl(ss, pm = map)
}
\seealso{
Other profile log-likelihood tibble functions: \code{\link{add_intercepts}},
\code{\link{add_pmap}},
\code{\link{assemble_profile_tib}},
\code{\link{transform_loglik_mat}}
}