Load example DO data from web. For convenience, we attach package
‘ggplot2’ for the autoplot
function. Functions from ‘qtl2’
are explicitly referenced with prefix qtl2::
.
library(qtl2ggplot)
library(ggplot2)
Download ‘qtl2’ cross2
object.
<-
DOex ::read_cross2(
qtl2file.path(
"https://raw.githubusercontent.com/rqtl",
"qtl2data/master/DOex",
"DOex.zip"))
With multiple alleles, it is useful to examine an additive allele model. Download pre-calculated allele probabilities (~5 MB) as follows:
<- tempfile()
tmpfile <- paste0("https://raw.githubusercontent.com/rqtl/",
file "qtl2data/master/DOex/DOex_alleleprobs.rds")
download.file(file, tmpfile)
<- readRDS(tmpfile)
apr unlink(tmpfile)
Alternatively, calculate these directly.
<- qtl2::calc_genoprob(DOex, error_prob=0.002)
pr <- qtl2::genoprob_to_alleleprob(pr) apr
Genome allele scan.
<- qtl2::scan1(apr, DOex$pheno) scan_apr
Summary of peaks.
::find_peaks(scan_apr, DOex$pmap) qtl2
## lodindex lodcolumn chr pos lod
## 1 1 OF_immobile_pct 2 96.84223 10.173313
## 2 1 OF_immobile_pct 3 15.02006 5.971503
## 3 1 OF_immobile_pct X 74.57257 6.939151
New summary method:
summary(scan_apr, DOex$pmap)
## # A tibble: 3 × 5
## pheno chr pos lod marker
## <chr> <fct> <dbl> <dbl> <chr>
## 1 OF_immobile_pct 2 96.8 10.2 backupUNC020000070
## 2 OF_immobile_pct 3 15.0 5.97 backupUNC030729939
## 3 OF_immobile_pct X 74.6 6.94 UNC200000454
The basic plot of genome scan,
plot(scan_apr, DOex$pmap)
and the grammar of graphics (ggplot2
) version.
autoplot(scan_apr, DOex$pmap)
Subset to chr 2.
<- DOex[,"2"]
DOex <- subset(apr, chr = "2") apr
<- qtl2::scan1(apr, DOex$pheno) scan_apr
::find_peaks(scan_apr, DOex$pmap) qtl2
## lodindex lodcolumn chr pos lod
## 1 1 OF_immobile_pct 2 96.84223 10.17331
plot(scan_apr, DOex$pmap)
autoplot(scan_apr, DOex$pmap)
<- qtl2::scan1coef(apr, DOex$pheno) coefs
New summary
method:
summary(coefs, scan_apr, DOex$pmap)
## # A tibble: 1 × 14
## pheno chr pos lod marker A B C D E F G
## <chr> <fct> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 OF_immobil… 2 96.8 10.2 backu… -6.93 -3.80 -6.27 -5.97 -30.1 -14.3 -3.87
## # … with 2 more variables: H <dbl>, intercept <dbl>
plot(coefs, DOex$pmap, 1:8, col = qtl2::CCcolors)
autoplot(coefs, DOex$pmap)
Plot allele effects over LOD scan.
plot(coefs, DOex$pmap, 1:8, col = qtl2::CCcolors, scan1_output = scan_apr)
autoplot(coefs, DOex$pmap, scan1_output = scan_apr,
legend.position = "none")
Examine just some of the founder effects, without centering.
plot(coefs, DOex$pmap, c(5,8), col = qtl2::CCcolors[c(5,8)])
autoplot(coefs, DOex$pmap, c(5,8))
autoplot(coefs, DOex$pmap, c(5,8), facet = "geno")
plot(coefs, DOex$pmap, 4:5, col = qtl2::CCcolors[4:5], scan1_output = scan_apr)