Description Usage Arguments Hidden graphics parameters See Also Examples
Plot SNP associations, with possible expansion from distinct snps to all snps.
1 2 3 4 |
scan1output |
Output of |
snpinfo |
Data frame with SNP information with the following
columns (the last three are generally derived from with
|
genes |
Optional data frame containing gene information for
the region, with columns |
lodcolumn |
LOD score column to plot (a numeric index, or a character string for a column name). Only one value allowed. |
show_all_snps |
If TRUE, expand to show all SNPs. |
add |
If TRUE, add to current plot (must have same map and chromosomes). |
drop_hilit |
SNPs with LOD score within this amount of the maximum SNP association will be highlighted. |
col_hilit |
Color of highlighted points |
col |
Color of other points |
gap |
Gap between chromosomes. |
minlod |
Minimum LOD to display. (Mostly for GWAS, in which
case using |
... |
Additional graphics parameters. |
A number of graphics parameters can be passed via ...
. For
example, bgcolor
to control the background color and altbgcolor
to control the background color on alternate chromosomes.
cex
for character expansion for the points (default 0.5),
pch
for the plotting character for the points (default 16),
and ylim
for y-axis limits.
plot_scan1()
, plot_coef()
, plot_coefCC()
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 45 46 47 | # load example DO data from web
library(qtl2geno)
file <- paste0("https://raw.githubusercontent.com/rqtl/",
"qtl2data/master/DOex/DOex.zip")
DOex <- read_cross2(file)
# subset to chr 2
DOex <- DOex[,"2"]
# calculate genotype probabilities and convert to allele probabilities
pr <- calc_genoprob(DOex, error_prob=0.002)
apr <- genoprob_to_alleleprob(pr)
# download snp info from web
tmpfile <- tempfile()
file <- paste0("https://raw.githubusercontent.com/rqtl/",
"qtl2data/master/DOex/c2_snpinfo.rds")
download.file(file, tmpfile, quiet=TRUE)
snpinfo <- readRDS(tmpfile)
unlink(tmpfile)
# SNP association scan
library(qtl2scan)
out_snps <- scan1snps(apr, DOex$pmap, DOex$pheno, snpinfo=snpinfo, keep_all_snps=TRUE)
# plot results
plot_snpasso(out_snps$lod, out_snps$snpinfo)
# can also just type plot()
plot(out_snps$lod, out_snps$snpinfo)
# plot just subset of distinct SNPs
plot_snpasso(out_snps$lod, out_snps$snpinfo, show_all_snps=FALSE)
# highlight the top snps (with LOD within 1.5 of max)
plot(out_snps$lod, out_snps$snpinfo, drop_hilit=1.5)
# download gene info from web
tmpfile <- tempfile()
file <- paste0("https://raw.githubusercontent.com/rqtl/",
"qtl2data/master/DOex/c2_genes.rds")
download.file(file, tmpfile, quiet=TRUE)
genes <- readRDS(tmpfile)
unlink(tmpfile)
# plot SNP association results with gene locations
plot(out_snps$lod, out_snps$snpinfo, drop_hilit=1.5, genes=genes)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.