Entering edit mode
James Perkins
▴
120
@james-perkins-4948
Last seen 10.3 years ago
Dear list,
Is there a way to keep track of the values used for the filter when
using
the getBM() function from the biomaRt package?
I have some genomic regions and want to find out what genes are in
these
regions. This is simple enough using getBM():
require(biomaRt)
ensembl = useMart("ensembl", dataset="hsapiens_gene_ensembl")
# For these Genomic regions:
regs <- c("10:66817823:68817823", "10:118963569:120963569",
"4:156786028:158786028")
# Get all genes in these regions and their start/end positions
genesInRegion <- getBM(mart=ensembl, filters="chromosomal_region",
value=regs, attr=c("ensembl_gene_id", "start_position",
"end_position"))
This results in a table of gene ids and the genomic locations of these
genes.
However, we lose data on what genes map to which of the original
regions
that were used for the search.
I could work this out as a further step, using e.g. GenomicRanges, but
I
wonder if there is simpler way, i.e. a way to keep track of the
original
values used for the getBM function call, and perhaps a way to return
them
as part of the getBM results along with the gene information.
I could just go through each genomic location in the regs vector, but
this
would take a long time for long lists of regions (the examples
included
here are just for illustrative purposes, in reality I will have a
large
list of smaller regions).
There was talk about producing a wrapper, quite a few years ago now,
but I
don't know if this happened:
https://stat.ethz.ch/pipermail/bioconductor/2009-November/030656.html
Any help/tips would be most appreciated,
Many thanks for your time,
Jim
--
James R Perkins, PhD
[[alternative HTML version deleted]]