[Bioc-sig-seq] Resizing a GRanges object with elements on the "*" strand

Steve Lianoglou mailinglist.honeypot at gmail.com
Fri Oct 1 18:00:01 CEST 2010


On 09/14/2010 01:46 PM, Michael Lawrence wrote:
> I just checked in some changes to IRanges, that make this method work:
> setMethod("resize", "GenomicRanges",
>           function(x, width, fix = "start", use.names = TRUE)
>           {
>             revFix <- c(start = "end", end = "start", center = "center")
>             fix <- ifelse(strand(x) == "-", revFix[fix], fix)
>             ranges <-
>               resize(ranges(x), width = width, fix = fix, use.names =
> use.names)
>             if (!IRanges:::anyMissing(seqlengths(x))) {
>               start(x) <- start(ranges)
>               end(x) <- end(ranges)
>             } else {
>               x <- clone(x, ranges = ranges)
>             }
>             x
>           }
>           )
> That will accept the fix argument, ...

Sorry to bring up an old thread -- but I want to use the "fix"
parameter in resizing GRanges objects in some of my code.

I see that this change has been made to SVN, but if I'm not mistaken,
it seems to not be coming to the GRanges stuff that's scheduled to
land w/ BioC 2.7/R-2.12?

Is this intentional? If so, how come? I don't think it'll break
backwards compatibility, right?

Maybe an oversight? (perhaps on my part, or "yours" :-)?

For now I think I'm just going to take this code and override the
BioC-2.7 version of resize, since I'd like to use it but can't upgrad
to svn GRanges since some of my stuff is getting hosed with the
"circular" stuff that's starting to be introduced.


Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

More information about the Bioc-sig-sequencing mailing list