Search
Question: Gviz GeneRegionTrack draw only one gene in the range
0
3.2 years ago by
tangming200590
United States
tangming200590 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?

" 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")
plotTracks(biomTrack)

How can I specify the filter here?

Thanks,

Ming Tang

modified 3.2 years ago by Robert Ivanek530 • written 3.2 years ago by tangming200590
2
3.2 years ago by
Robert Ivanek530
Switzerland
Robert Ivanek530 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:

library(biomaRt)
mart <- useMart("ensembl")
mart <- useDataset("hsapiens_gene_ensembl",mart)
listFilters(mart)

The one you are probably interested in is the following:

listFilters(mart)[70,]

So the call in Gviz can look like this:

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

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
1

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"))