[BioC] Elementwise appending of List elements?

Hervé Pagès hpages at fhcrc.org
Thu Jun 19 01:08:17 CEST 2014


On 06/18/2014 03:38 PM, Ryan C. Thompson wrote:
> Hi,
>
> Is this only for the devel version? There doesn't seem to be an
> S4Vectors package for R 3.1.0.

In BioC release (2.14), make_XYZxyz_to_XxYyZz_subscript() is
in IRanges.

Note that both BioC release (2.14) and devel (3.0) use R 3.1.0. The
S4Vectors package is new in BioC devel. It's a split from the IRanges
package so most of the stuff that is now in S4Vectors used to be in IRanges.

H.

>
> -Ryan
>
> On Wed 18 Jun 2014 11:51:57 AM PDT, Hervé Pagès wrote:
>> Hi Ryan,
>>
>> On 06/18/2014 11:33 AM, Ryan C. Thompson wrote:
>>> Hi all,
>>>
>>> I have 2 CharacterList objects (let's call them A and B) of equal
>>> length, and I want to append the each element of List A to the
>>> corresponding one in List B and get the resulting CharacterList. I can
>>> do this with mendoapply(c, A, B), but this is quite slow. Is there a
>>> function to do this quickly?
>>
>> Code adapted from "junctions" method for GAlignmentPairs objects:
>>
>>   library(GenomicAlignments)
>>
>>   pcombine <- function(x, y)
>>   {
>>     stopifnot(length(x) == length(y))
>>     xy <- c(x, y)
>>     collate_subscript <-
>>       S4Vectors:::make_XYZxyz_to_XxYyZz_subscript(length(x))
>>     tmp <- xy[collate_subscript]
>>     GenomicAlignments:::shrinkByHalf(tmp)
>>   }
>>
>> I'll add something like this to S4Vectors.
>>
>> Cheers,
>> H.
>>
>>>
>>> -Ryan
>>>
>>> _______________________________________________
>>> 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
>>

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioconductor mailing list