comp {seqinr} | R Documentation |
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.
comp(seq)
seq |
a vector of chars |
a vector of characters which is the complement of the sequence.
D. Charif, J.R. Lobry
citation("seqinr")
Because ssDNA sequences are always written in the 5'->3'
direction, use rev(comp(seq)) to get the reverse complementary
strand (see rev
).
## ## 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"))))