View source: R/merge_feature.R
ggplot_merge_feature | R Documentation |
Merge all SNPs in small region with LOD peaks across multiple phenotype.
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"), ...)
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 |
ggplot2 object
tbl with added information on genes and exons
table summary
Brian S Yandell, brian.yandell@wisc.edu
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.