Seems reasonable to me...

On Thu, Apr 26, 2012 at 5:17 PM, Steve Lianoglou <
mailinglist.honeypot@gmail.com> wrote:

> Howdy,
>
> I was chasing some weird bug for a while which was due to a library I
> use working differently w/ factors and the fact that a call to
> as.data.frame(GRanges)  doesn't let you specify how you want to handle
> stringsAsFactors for the character columns of the
> GRanges@elementMetadata.
>
> What do you say to a change that passes `...` down to the
> `as.data.frame(elementMetadata(x))` call in the following method def
> (GenomicRanges-class.R#Line245) here so it becomes
> `as.data.frame(elementMetadata(x), ...)` allowing us to control this
> behavior:
>
> setMethod("as.data.frame", "GenomicRanges",
>    function(x, row.names=NULL, optional=FALSE, ...)
>    {
>        ranges <- ranges(x)
>        if (missing(row.names))
>            row.names <- names(x)
>        if (!is.null(names(x)))
>            names(x) <- NULL
>        data.frame(seqnames=as.factor(seqnames(x)),
>                   start=start(x),
>                   end=end(x),
>                   width=width(x),
>                   strand=as.factor(strand(x)),
>                   as.data.frame(elementMetadata(x)), ## <-- here
>                   row.names=row.names,
>                   stringsAsFactors=FALSE)
>    }
> )
>
> -steve
>
> --
> 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
>
> _______________________________________________
> Bioc-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>

	[[alternative HTML version deleted]]

