There's probably several ways to tighten up the GRanges part of the code,
but looking at overlaps, etc. is much easier with fast interval mappings.
 It takes a bit of getting used to, however I have never seen a single
person go back after getting used to the GenomicRanges approach to doing
these things.  YMMV

Will look into the issue with toggleProbes.  According to the
documentation, it should work, but I get the same error that you do.  I
tried poking around a bit:

showMethods("toggleProbes")
## Function: toggleProbes (package AnnotationDbi)
## x="ProbeAnnDbBimap"
## x="ProbeAnnDbMap"
## x="ProbeGo3AnnDbBimap"
## x="ProbeIpiAnnDbMap"

toggleProbes(as(IlluminaHumanMethylation450kPROBELOCATION,
'ProbeAnnDbBimap'), 'all')
## Error in .toggleFilter(x, value) :
##  This method can only be used on mappings where the Lkeys are probes.

Perhaps the problem is that IlluminaHumanMethylation450kPROBELOCATION is
joining tables?

## from zzz.R in the package... comments are verbatim from when I first put
it together
##
## handy for finding out whether we're dealing with a promoter, body, UTR...
IlluminaHumanMethylation450kPROBELOCATION<-
AnnotationForge:::createSimpleBimap(
"probelocation","Probe_ID","location",datacache,"PROBELOCATION","IlluminaHumanMe
thylation450k.db")

hmmm.




On Tue, Jul 2, 2013 at 12:25 PM, Simone <enomis.bioc@gmail.com> wrote:

> Dear Tim,
>
> Thanks a lot for your comprehensive reply. The code you posted seems
> quite complicated, I'll have a closer look on it tomorrow. I am just
> writing already now to tell you that I made a mistake in my previous
> posting: I did not mean IlluminaHumanMethylation450kPATH2PROBE, but
> IlluminaHumanMethylation450kPROBELOCATION. I mixed it up with some
> tests I did regarding toggleProbes(). Sorry!
>
> However, I get the same error for
> IlluminaHumanMethylation450kPROBELOCATION (which is probably the
> reason why I finally mixed it up):
>
>  x <- toggleProbes(IlluminaHumanMethylation450kPROBELOCATION, "all")
> Error in (function (classes, fdef, mtable)  :
>   unable to find an inherited method for function ‘toggleProbes’ for
> signature ‘"AnnDbBimap"’
>
> Best wishes,
> Simone
>
> On Tue, Jul 2, 2013 at 7:25 PM, Tim Triche, Jr. <tim.triche@gmail.com>
> wrote:
> > re: IlluminaHumanMethylation450kPATH2PROBE
> >
> > This one is new to me.  I suspect that not all probes have a pathway
> mapped
> > to them, but I will have to investigate further.  If it's a KEGG issue,
> it
> > may not be possible to resolve this due to KEGG's deprecation.
> >
> >
> >
> > On Tue, Jul 2, 2013 at 2:14 AM, Simone <enomis.bioc@gmail.com> wrote:
> >>
> >> Dear Tim,
> >>
> >> > You will need to use toggleProbes() to get all probe locations (this
> is
> >> > an
> >> > undesirable side effect of the db0 package infrastructure, which is
> >> > geared
> >> > towards expression arrays where probes that map to multiple accessions
> >> > are a
> >> > "bad thing", and that is the reason I deprecated the 27k.db and
> 450k.db
> >> > packages).
> >>
> >> I understand. However, also with toggleProbes() I have got a problem.
> >> I tried for example:
> >>
> >> > x <- toggleProbes(IlluminaHumanMethylation450kPATH2PROBE, "all")
> >>
> >> Error in (function (classes, fdef, mtable)  :
> >>   unable to find an inherited method for function ‘toggleProbes’ for
> >> signature ‘"AnnDbBimap"’
> >>
> >> But for example the following works
> >>
> >> > x <- toggleProbes(IlluminaHumanMethylation450kENSEMBL2PROBE, "all")
> >>
> >> However, I would need the location information, so the column
> >> "transcript_location" (e.g. 5'UTR, TSS200, Body, etc.) and it seems
> >> that I cannot get it like this?
> >>
> >> > The FDb.InfiniumMethylation packages have the locations of the
> targeted
> >> > CpGs
> >> > (and CpHs, and SNPs) for the corresponding build (just for the record,
> >> > the
> >> > genome build targeted by 450k.db is hg19/GRch37), but they are
> returned
> >> > using get450k() or get27k() as a GRanges object.
> >>
> >> Currently, this doesn't work for me neither (see my previous post).
> >> Probably I'm doing something wrong ...
> >>
> >> > Essentially, the mistake I made in compiling the 27k.db and 450k.db
> >> > packages
> >> > was to use an expression-centric (or gene- and transcript-centric)
> >> > infrastructure to represent probes targeting individual loci.  It's
> more
> >> > useful to think of the 450k array, in particular, as a SNP array, with
> >> > functions for a given target locus inferred after discovery.  It's
> also
> >> > more
> >> > useful to think of the chip as a SNP array when considering
> >> > differentially
> >> > methylated regions, which could be loosely regarded as the methylation
> >> > equivalent of copy number variations.  Last but not least, you can in
> >> > fact
> >> > use the array to estimate copy number along the genome, as for
> >> > determining
> >> > sex from chrX copy number.
> >>
> >> Thank you for your hints and explanations!
> >> But at the moment I am still stucked at a much simpler step, I would
> >> just need an easy way to distinguish probes located in promoters from
> >> those located in gene bodies (and to discard those which are annotated
> >> to both).
> >>
> >> Best wishes,
> >> Simone
> >
> >
> >
> >
> > --
> > A model is a lie that helps you see the truth.
> >
> > Howard Skipper
>



-- 
*A model is a lie that helps you see the truth.*
*
*
Howard Skipper<http://cancerres.aacrjournals.org/content/31/9/1173.full.pdf>

	[[alternative HTML version deleted]]

