Gviz and older ENSEMBL biomarts
2
0
Entering edit mode
fmueller • 0
@fmueller-6942
Last seen 9.4 years ago
Germany

Thanks again for the hard work on the Gviz package. I find it really useful. I encountered a small issue concerning Gene tracks from BioMarts. Since I occasionally work with older genome assemblies I sometimes need to use older versions of the Ensembl Biomarts. E.g.:

useMart("ENSEMBL_MART_ENSEMBL", dataset = "hsapiens_gene_ensembl",host="feb2014.archive.ensembl.org")

The problem is now that the Gviz function 'BiomartGeneRegionTrack' throws the following error since it cannot find an annotation column in the old Biomart that is there in the current Ensembl biomart:

 

> BiomartGeneRegionTrack(genome=assembly,biomart=mart,chromosome=chrom,start=start,end=end,name="ENSEMBL genes")

Error in getBM(attributes, filters = filterNames, values = filterValues,  : 

  Invalid attribute(s): external_gene_name 

Please use the function 'listAttributes' to get valid attribute names

> traceback()

7: stop(paste("Invalid attribute(s):", paste(attributes[invalid], 

       collapse = ", "), "\nPlease use the function 'listAttributes' to get valid attribute names"))

6: getBM(attributes, filters = filterNames, values = filterValues, 

       bmHeader = FALSE, mart = .Object@biomart, uniqueRows = TRUE)

5: .local(.Object, ...)

4: initialize(value, ...)

3: initialize(value, ...)

2: new("BiomartGeneRegionTrack", start = start, end = end, chromosome = chromosome, 

       strand = strand, biomart = biomart, name = name, genome = genome, 

       stacking = stacking, filters = filters, ...)

1: BiomartGeneRegionTrack(genome = assembly, biomart = mart, chromosome = chrom, 

       start = start, end = end, name = "ENSEMBL genes")

 

It would be great if you could look into this. Thanks a lot in advance!

gviz biomart • 2.1k views
ADD COMMENT
1
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 5.5 years ago
Switzerland

Hi Fabian,

this came up a couple of times recently after Ensembl decided to change their data base schema. The problem is that Gviz tries to be smart and do the mapping of Biomart fields to track features automatically. I decided to make this whole part accessible by the end user now for cases like this, and the next development version (1.11.2) comes with these new features. Here is the respective section from the vignette:

\subsubsection*{Using custom biomaRt objects for BiomartGeneRegionTracks}

\mgg tries hard to automatically set up the necessary connection to

the Biomart service to retrieve the relevant data. Sometimes however

it can be advantagous to fully control the Biomart connector, for

instance when trying to retrieve data from an archived Ensembl version

(by default, \Rpackage{biomaRt} will always link to the most recent

version). To that end, the \Rfunarg{biomart} parameter can be used to

supply a \Robject{biomaRt} object. Please note that a data set has to

be selected in that object. A second prerequesite for this to work is

that \mgg is able to guess which of the values that are queried

from the Ensembl data base represent which track feature. If there

were no changes in the schema of Ensembl, or if the schema for all

marts was similar this would not be an issue, but that is not the

case. In the following example we show how to fetch data for the same

region from the older version Ensembl version 47. The internal

\Rfunction{.getBMFeatureMap} is helpful to set up the feature mapping

which is necessary because Esembl used to call the gene symbol field

\code{external\_gene\_id} in that release.

 

library(biomaRt)

bm <- useMart(host="oct2012.archive.ensembl.org", biomart="ENSEMBL_MART_ENSEMBL",

              dataset="hsapiens_gene_ensembl")

fm <- Gviz:::.getBMFeatureMap()

fm["symbol"] <- "external_gene_id"

biomTrack <- BiomartGeneRegionTrack(genome="hg19", chromosome="chr7", start=20e6, end=21e6,name="ENSEMBL",

                                    featureMap=fm, biomart=bm)

plotTracks(biomTrack, col.line=NULL, col=NULL, stackHeight=0.3)

I can push these changes back to the release branch as well, but it will take one or two days to trickle through the system. Please look out for version 1.10.2.

Florian

ADD COMMENT
0
Entering edit mode
Gviz_1.10.11 
fm <- Gviz:::.getBMFeatureMap()

throws an error:

Fehler in get(name, envir = asNamespace(pkg), inherits = FALSE) :
  Object '.getBMFeatureMap' not found

 

ADD REPLY
0
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 5.5 years ago
Switzerland

I don't think that you are really on Gviz_1.10.11. Maybe there are conflicting package installations somewhere in your libPath. Please post your sessionInfo() output at the time you try the above command to be sure.

ADD COMMENT

Login before adding your answer.

Traffic: 731 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6