Plot SNP associations
Plot SNP associations, with possible expansion from distinct snps to all snps.
plot_snpasso( scan1output, snpinfo, genes = NULL, lodcolumn = 1, show_all_snps = TRUE, chr = NULL, add = FALSE, drop_hilit = NA, col_hilit = "violetred", col = "darkslateblue", gap = NULL, minlod = 0, ... )
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. |
chr |
Vector of character strings with chromosome IDs to plot. |
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. The default is 1% of the total genome length. |
minlod |
Minimum LOD to display. (Mostly for GWAS, in which
case using |
... |
Additional graphics parameters. |
None.
A number of graphics parameters can be passed via ...
. For
example, bgcolor
to control the background color,altbgcolor
to control the background color on alternate chromosomes,
altcol
to control the point 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.
## Not run: # load example DO data from web 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) # query function for grabbing info about variants in region snp_dbfile <- system.file("extdata", "cc_variants_small.sqlite", package="qtl2") query_variants <- create_variant_query_func(snp_dbfile) # SNP association scan out_snps <- scan1snps(apr, DOex$pmap, DOex$pheno, query_func=query_variants, chr=2, start=97, end=98, 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(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) # query function for finding genes in region gene_dbfile <- system.file("extdata", "mouse_genes_small.sqlite", package="qtl2") query_genes <- create_gene_query_func(gene_dbfile) genes <- query_genes(2, 97, 98) # plot SNP association results with gene locations plot(out_snps$lod, out_snps$snpinfo, drop_hilit=1.5, genes=genes) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.