gene_exon {qtl2pattern} | R Documentation |
Get exons for set of genes
Description
Match up exon start,stop,strand with genes. Use query_genes
to find features; see create_gene_query_func
.
Returns table of gene and its exons.
Uses gene_exon
to plot genes, exons, mRNA with SNPs.
Usage
gene_exon(
top_snps_tbl,
feature_tbl = query_genes(chr_id, range_Mbp[1], range_Mbp[2])
)
## S3 method for class 'gene_exon'
summary(object, gene_name = NULL, top_snps_tbl = NULL, extra = 0.005, ...)
## S3 method for class 'gene_exon'
subset(x, gene_val, ...)
ggplot_gene_exon(
object,
top_snps_tbl = NULL,
plot_now = TRUE,
genes = unique(object$gene),
...
)
## S3 method for class 'gene_exon'
autoplot(object, ...)
Arguments
top_snps_tbl |
table from |
feature_tbl |
table of features from |
object |
Object of class |
gene_name |
name of gene as character string |
extra |
extra region beyond gene for SNPs (in Mbp) |
... |
arguments passed along to |
x |
Object of class |
gene_val |
Name of gene from object |
plot_now |
plot now if TRUE |
genes |
Names of genes in |
Value
tbl of exon and gene features
tbl of summary
list of ggplots (see gene_exon
)
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)
# 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)
# Get Gene exon information.
out <- gene_exon(top_snps_tbl, gene_tbl)
summary(out, gene = out$gene[1])
[Package qtl2pattern version 1.2.1 Index]