[BioC] Coercing SimpleList to CompressedList objects
Martin Morgan
mtmorgan at fhcrc.org
Sat Jul 6 02:23:21 CEST 2013
Hi Leonard --
On 07/03/2013 05:58 PM, Leonard Goldstein wrote:
> Dear all,
>
> I ran into some trouble when trying to coerce SimpleList to CompressedList objects.
>
> It is possible to coerce CompressedList to SimpleList objects via the constructor function. For example:
>
>> lc <- IntegerList(1:10, compress = TRUE)
>> class(lc)[1]
> [1] "CompressedIntegerList"
>> class(IntegerList(lc, compress = FALSE))[1]
> [1] "SimpleIntegerList"
>
> However, the converse is not supported:
>
>> ls <- IntegerList(1:10, compress = FALSE)
>> class(ls)[1]
> [1] "SimpleIntegerList"
>> class(IntegerList(ls, compress = TRUE))[1]
> [1] "SimpleIntegerList"
>
> Would it be possible to implement coercion in both directions?
Maybe Herve or Michael will offer up a proper solution. A back-door is
relist(unlist(ls), ls)
Martin
>
> Many thanks for your help,
>
> Leonard
>
>
>> sessionInfo()
> R version 3.0.1 (2013-05-16)
> Platform: x86_64-apple-darwin10.8.0 (64-bit)
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] parallel stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] IRanges_1.19.15 BiocGenerics_0.7.2
>
> loaded via a namespace (and not attached):
> [1] stats4_3.0.1 tools_3.0.1
>>
>
> --
> Leonard Goldstein, PhD
> Postdoctoral Research Fellow
> Department of Bioinformatics & Computational Biology
> Genentech, Inc.
>
> _______________________________________________
> 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: Arnold Building M1 B861
Phone: (206) 667-2793
More information about the Bioconductor
mailing list