Hi all,

As described in the doc for reverse, complement and reverseComplement, x can be a character vector.

When I tried, it turned out that these functions are not implemented for complement and reverseComplement.

There are of some use for me, so I just wrote them up:

setMethod("complement", "character",
    function(x, ...){
                if(length(x)==1) x<-DNAString(x)
                else x<-DNAStringSet(x)
                complement(x)
    }
)

setMethod("reverseComplement", "character",
    function(x, ...){
                if(length(x)==1) x<-DNAString(x)
                else x<- DNAStringSet(x)
                reverseComplement(x)
    }
)

I just post them in case there would be of use for someone else. I recognize that it does not save much compared to first converting the character vector into a DNAString or DNAStringSet. At least, for me, it allows to skip some "input" evaluation test checking whether I start with a character vector or a DNAString.

Best,

---------------------------------------------------------------
Nicolas Delhomme

High Throughput Functional Genomics Center

European Molecular Biology Laboratory

Tel: +49 6221 387 8426
Email: [email protected]
Meyerhofstrasse 1 - Postfach 10.2209
69102 Heidelberg, Germany

_______________________________________________
Bioc-sig-sequencing mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

Reply via email to