ggplot_merge_feature {qtl2pattern} | R Documentation |
Plot of merge_feature object
Description
Merge all SNPs in small region with LOD peaks across multiple phenotype.
Usage
ggplot_merge_feature(object, pheno, plot_by = c("pattern", "consequence"), ...)
## S3 method for class 'merge_feature'
autoplot(object, ...)
merge_feature(
top_snps_tbl,
snpinfo,
out_lmm_snps,
drop = 1.5,
dropchar = 0,
exons = gene_exon(top_snps_tbl)
)
## S3 method for class 'merge_feature'
summary(object, sum_type = c("SNP type", "pattern"), ...)
Arguments
object |
of class |
pheno |
name of phenotype to be plotted |
plot_by |
element to plot by (one of |
... |
other arguments not used |
top_snps_tbl |
tbl from |
snpinfo |
SNP information table |
out_lmm_snps |
tbl from |
drop |
include LOD scores within |
dropchar |
number of characters to drop on phenames |
exons |
table from |
sum_type |
one of |
Value
ggplot2 object
tbl with added information on genes and exons
table summary
Author(s)
Brian S Yandell, brian.yandell@wisc.edu
Examples
dirpath <- "https://raw.githubusercontent.com/rqtl/qtl2data/master/DOex"
# Read DOex example cross from 'qtl2data'
DOex <- subset(qtl2::read_cross2(file.path(dirpath, "DOex.zip")), chr = "2")
# Download genotype probabilities
tmpfile <- tempfile()
download.file(file.path(dirpath, "DOex_genoprobs_2.rds"), tmpfile, quiet=TRUE)
pr <- readRDS(tmpfile)
unlink(tmpfile)
# Download SNP info for DOex from web and read as RDS.
tmpfile <- tempfile()
download.file(file.path(dirpath, "c2_snpinfo.rds"), tmpfile, quiet=TRUE)
snpinfo <- readRDS(tmpfile)
unlink(tmpfile)
snpinfo <- dplyr::rename(snpinfo, pos = pos_Mbp)
# Convert to SNP probabilities
snpinfo <- qtl2::index_snps(DOex$pmap, snpinfo)
snppr <- qtl2::genoprob_to_snpprob(pr, snpinfo)
# Scan SNPs.
scan_snppr <- qtl2::scan1(snppr, DOex$pheno)
# Collect top SNPs
top_snps_tbl <- top_snps_pattern(scan_snppr, snpinfo)
summary(top_snps_tbl)
# Download Gene info for DOex from web via RDS
tmpfile <- tempfile()
download.file(file.path(dirpath, "c2_genes.rds"), tmpfile, quiet=TRUE)
gene_tbl <- readRDS(tmpfile)
unlink(tmpfile)
out <- merge_feature(top_snps_tbl, snpinfo, scan_snppr, exons = gene_tbl)
summary(out, "pattern")
[Package qtl2pattern version 1.2.1 Index]