[BioC] flip strand information in GappedAlignments or GRangesList Object
zarnack at ebi.ac.uk
Fri Mar 30 14:42:05 CEST 2012
I think you have to add vector() to strand(ga), since the strand
information comes as Rle which does not work in the ifelse() test
directly. At least this is my experience with GRanges objects.
On 30/03/12 13:37, Steve Lianoglou wrote:
> On Fri, Mar 30, 2012 at 6:04 AM, Stefanie<stefanie.tauber at univie.ac.at> wrote:
>> Dear list,
>> having a GappedAlignments or GRangesList object at hand,
>> what is the quickest way to flip strand signs?
>> So for each entry, I want to flip "-" to "+" and vice versa.
> Let's assume that your GappedAlignments object is called `ga`, I think
> this should work, no?
> R> strand(ga)<- ifelse(strand(ga) == '+', '-', '+')
> To the devs:
> For some reason, `example(GappedAlignments)` is throwing the following
> error on me, so I can't actually test at the moment:
> Error in elementLengths(rglist(x)) :
> error in evaluating the argument 'x' in selecting a method for
> function 'elementLengths': Error in .Call(.NAME, ..., PACKAGE =
> PACKAGE) :
> Incorrect number of arguments (6), expecting 4 for
> sessionInfo() pasted below.
> R version 2.15.0 RC (2012-03-24 r58823)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>  en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
> attached base packages:
>  stats graphics grDevices utils datasets methods base
> other attached packages:
>  Rsamtools_1.7.41 Biostrings_2.23.6 GenomicRanges_1.7.40
>  IRanges_1.13.34 BiocGenerics_0.1.14
Dr. Kathi Zarnack
European Bioinformatics Institute
Wellcome Trust Genome Campus
CB10 1SD, UK
tel +44 1223 494 526
More information about the Bioconductor