[BioC] Gviz

Steve Lianoglou lianoglou.steve at gene.com
Tue May 14 18:00:44 CEST 2013


Hi,

On Tue, May 14, 2013 at 8:47 AM, Hahne, Florian
<florian.hahne at novartis.com> wrote:
> Hi Fiorella,
> you can do this filtering directly in the constructor function. Take a
> look at the 'filters' argument in the help page for the
> BiomartGeneRegionTrack class. It's value is directly forwarded to
> biomaRt's getBM function, so it's documentation as well as 'listFilters'
> might also be instructive. Your particular case would probably boil down
> to something like this:
>
> biomTrack <- BiomartGeneRegionTrack(genome = "hg19", chromosome = chr,
> start = 63038367 , end = 64536346, name = "ENSEMBLE",
> filters=list(biotype="protein_coding")
>
> I find it quite useful when creating more complex biomaRt queries to first
> construct something similar in the web interface and then look at the XML
> representation of the query (there is a button for it)

It seems that the problem is that the `biotype` is set at the gene
level, and not the transcript level. You'll see that doing this still
returns all transcripts for PPM1H.

In theory, filtering by `transcript_biotype == 'protein_coding` should
do the trick, but you get some error like so:

  Query ERROR: caught BioMart::Exception::Usage: Attributes from
multiple attribute pages are not allowed

I can run around this by doing a second query then filtering on the
transript ids that are only protein_coding. Maybe something a bit more
elgant than:

R> check <- getBM(c('transcript_biotype', 'ensembl_transcript_id'),
filters=c('chromosome_name', 'start', 'end'),
values=list(chromosome_name='12', start=63038367, end=64536346),
mart=m)

R> biomPC <- biomTrack
R> ranges(biomPC) <-
ranges(biomTrack)[mcols(ranges(biomTrack))$transcript %in%
subset(check, transcript_biotype ==
"protein_coding")$ensembl_transcript_id]

Ouch .. like I said, there's probably a more elegant way to get that,
but there it is.

HTH,
-steve

--
Steve Lianoglou
Computational Biologist
Department of Bioinformatics and Computational Biology
Genentech



More information about the Bioconductor mailing list