Object in R

Factor can be used for sequence data.

From sequence characters

seq <- c("A", "C", "C", "T", "G")
seq.factor <- factor(seq, levels=c("A", "G", "T", "C")
From numbers to sequences
> seq.num <- c(1,2,3,1,1,3,2,1,4,1,3,2,1)
> seq.num.factor <- factor(seq.num, levels=c(1,2,3,4), labels=c("A","G","T","C") )