Tim Triche, Jr. | 21 Feb 07:55 2013
Picon

Re: Generate a GRangesList from a classical list of GRangesObjects

library(GenomicRanges)

blah <- list(foo=GRanges(), bar=GRanges(), baz=GRanges())
class(blah)
## [1] "list"

bleh <- GRangesList(blah)
class(bleh)
## [1] "GRangesList"
## attr(,"package")
## [1] "GenomicRanges"

In other words, I think you're looking for the GRangesList() function.

On Wed, Feb 20, 2013 at 12:33 PM, Hermann Norpois <hnorpois@...>wrote:

> Hello,
>
> I would like to generate a GRangesList object from multiple narrow peak
> files. I tried this and it works:
>
> ord <- function (ddir, namen){ #ddir is the directory of interest and namen
> a vector with names e.g. "GSM1008569" "GSM1008578" "GSM1008583"
>
>
> open.list <- sapply (namen, function (x) {feile <- list.files (ddir,
> pattern=x, full.names=TRUE)
>                                feile <- read.table (feile)
>                                file.gr <- GRanges (seqnames=feile$V1,
> ranges= IRanges (start=feile$V2, end=feile$V3), edensity=feile$V5,
> epeak=feile$V10)
>
>                                         }
>
>                      )
> names(open.list) <- namen
>     return (open.list)
>   }
>
> After for instance
>
> test <- ord (ddir, namen)
>
> I get a nice list of GRange objects but I would like to transform this in a
> GRangesList. How does it work?
> If there is an alternative approach to generate a GRangeList directly ( I
> guess there is one but I did not find a way to manage this) please let me
> know.
>
> Thanks
> Hermann
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@...
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

--

-- 
*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]]

_______________________________________________
Bioconductor mailing list
Bioconductor@...
https://stat.ethz.ch/mailman/listinfo/bioconductor
Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor


Gmane