[BioC] more stupid *Ranges questions...

Martin Morgan mtmorgan at fhcrc.org
Fri Sep 16 06:08:37 CEST 2011


On 09/15/2011 03:02 PM, Michael Lawrence wrote:
> Easiest path is to convert the RangedData to a GRanges:

FWIW, I used

   showMethods(nearest)

to see what methods were defined (things need to be or extend Ranges, or 
GenomicRanges, but not both), then looked for ways to coerce between the 
types in hand.

   showMethods(coerce, class=c("GRanges", "RangedData"))

admittedly requiring a little too much understanding about the class 
hierarchy.

Martin

>
> as(TSS.human.GRCh37, "GRanges")
>
> I might recommend though to get the TSS's from GenomicFeatures::transcripts.
>
> Michael
>
> On Thu, Sep 15, 2011 at 2:28 PM, Tim Triche, Jr.<tim.triche at gmail.com>wrote:
>
>> I have a GenomicRanges object built from interrogated sites and a
>> RangedData
>> object of human (allegedly canonical) transcription start sites, from Julie
>> Zhu's ChIPpeakAnno package.  I want to walk up and down each chromosome and
>> find the nearest forward and reverse strand TSS and their distance from
>> each
>> site.  This seems like it would work:
>>
>>> nearest(cpgranges, TSS.human.GRCh37)
>>
>> But one of the objects isn't the right type:
>>
>> Error in function (classes, fdef, mtable)  :
>>   unable to find an inherited method for function "nearest", for signature
>> "GRanges", "RangedData"
>>
>> What's the right way to solve this problem?  I know about follow() and
>> precede(), but those won't work either until I solve this :-)
>>
>> thanks!
>>
>>
>>
>> --
>> If people do not believe that mathematics is simple, it is only because
>> they
>> do not realize how complicated life is.
>> John von Neumann<
>> http://www-groups.dcs.st-and.ac.uk/~history/Biographies/Von_Neumann.html>
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at 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]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



More information about the Bioconductor mailing list