Question: Gviz GeneRegionTrack draw only one gene in the range
gravatar for tangming2005
4.2 years ago by
United States
tangming2005140 wrote:

Hi there,

I want to draw only one gene model in one genomic range ( some genes have overlapping ranges).

How can I do it using GeneRegionTrack in the Gviz package?

I read the tutorial, 

" Alternatively, one can provide the Ensembl trancript or gene id via the transcript or gene arguments, or an Entrez id via the entrez argument. In all of these cases the constructor will also fetch models for other genes that overlap the same region. If that is not desired one needs to provide an explicit Biomart filter. 

biomTrack <- BiomartGeneRegionTrack(genome = "hg19", name = "ENSEMBL", symbol = "ABCB5") 

How can I specify the filter here?


Ming Tang


gviz • 1.8k views
ADD COMMENTlink modified 4.2 years ago by Robert Ivanek640 • written 4.2 years ago by tangming2005140
Answer: Gviz GeneRegionTrack draw only one gene in the range
gravatar for Robert Ivanek
4.2 years ago by
Robert Ivanek640
Robert Ivanek640 wrote:

Please have a look on the documentation of the getBM function from biomaRt package how to specify the filters. Here is an example how you can list all available filters for human genome:

mart <- useMart("ensembl")
mart <- useDataset("hsapiens_gene_ensembl",mart)

The one you are probably interested in is the following:


So the call in Gviz can look like this:

biomTrack <- BiomartGeneRegionTrack(genome = "hg19", name = "ENSEMBL", symbol = "ABCB5", transcriptAnnotation = "symbol", filters=list(hgnc_symbol="ABCB5"))


ADD COMMENTlink written 4.2 years ago by Robert Ivanek640

Thanks for your answer. It solved my question. Now I want only one specific transcript, but it gave an error. I checked that 

with_ens_hs_transcript is a valid filter.

biomTrack <- BiomartGeneRegionTrack(genome = "hg19", name = "ENSEMBL", symbol = "KIT",
+                                     filters=list(with_ens_hs_transcript="ENST00000288135"))
Error in getBM(as.vector(featureMap), filters = names(filterValues), values = filterValues,  : 
  Invalid filters(s): with_ens_hs_transcript 
Please use the function 'listFilters' to get valid filter names
ADD REPLYlink modified 4.2 years ago • written 4.2 years ago by tangming2005140

I am not a biomaRt expert but I would say that the filter "with_ens_hs_transcript" is used to restrict the output only to items with Ensembl Human Transcript IDs but you cannot use it to filter for specific transcript it. For that you need to use filter called "ensembl_transcript_id". Something like this might work for you:

biomTrack <- BiomartGeneRegionTrack(genome = "hg19", name = "ENSEMBL", symbol = "KIT", filters=list(ensembl_transcript_id="ENST00000288135"))
ADD REPLYlink written 4.2 years ago by Robert Ivanek640

Yes, you are right. Thank you very much!

ADD REPLYlink written 4.2 years ago by tangming2005140
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 223 users visited in the last hour