Description Usage Arguments Details Value Examples
View source: R/create_ensembl_query_func.R
Create a function that will query genes from a GenomicRanges object with ensembl gene annotations and return a data frame with gene information for a selected region.
1 | create_ensembl_query_func(ensembl, full_genes_only = TRUE)
|
ensembl |
Ensembl gene annotations as a GenomicRanges object. |
full_genes_only |
If TRUE, filter by |
Note that this function assumes that the database has
start
and end
fields that are in basepairs, but
the selection uses positions in Mbp, and the output data frame
should have start
and stop
columns in Mbp.
Function with three arguments, chr
, start
,
and end
, which returns a data frame with the genes
overlapping that region, with start
and end
being
in Mbp. The output should contain at least the columns
Name
, chr
, start
, and stop
, the
latter two being positions in Mbp.
1 2 3 4 5 6 7 8 | # small version of ensembl data
ensembl <- readRDS(system.file("extdata", "ensembl_small.rds", package="qtl2bioc"))
# create query function, pulling only full genes
query_ensembl <- create_ensembl_query_func(ensembl)
# genes on chr 2 overlapping (96.5 - 97.0)
genes <- query_ensembl("2", 96.5, 97.0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.