comp {seqinr}R Documentation

complements a nucleic acid sequence

Description

Complements a sequence, for instance if the sequence is "a","c","g","t" it returns "t","g","c","a". All other values will return NA. This is not the reverse complementary strand.

Usage

comp(seq)

Arguments

seq a vector of chars

Value

a vector of characters which is the complement of the sequence.

Author(s)

D. Charif, J.R. Lobry

References

citation("seqinr")

See Also

Because ssDNA sequences are always written in the 5'->3' direction, use rev(comp(seq)) to get the reverse complementary strand (see rev).

Examples

##
## Show that comp() does not return the reverve complementary strand:
##
c2s(comp(s2c("aaaattttggggcccc")))
##
## Show how to get the reverse complementary strand:
##
c2s(rev(comp(s2c("aaaattttggggcccc"))))
##
## Show what's happen with non allowed values:
##
c2s(rev(comp(s2c("aaaaXttttYggggZcccc"))))

[Package seqinr version 1.0-6 Index]