Hi Floriella, Steve,

How about using the with_protein_id filter instead:

mart=useMart("ensembl","hsapiens_gene_ensembl")
biomTrack <- BiomartGeneRegionTrack(genome = "hg19", chromosome =
"chr12",start = 63038367 , end = 64536346, name = "ENSEMBLE",
filters=list("with_protein_id"=TRUE),mart=mart,showId=TRUE)

This will only show transcripts that have a protein id and thus produce
proteins.

Cheers,
Steffen


On Tue, May 14, 2013 at 9:00 AM, Steve Lianoglou
<lianoglou.steve@gene.com>wrote:

> Hi,
>
> On Tue, May 14, 2013 at 8:47 AM, Hahne, Florian
> <florian.hahne@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
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

