特に難しいものではないと思う。
プログラム検証に例が100個も必要か?
CS2BS = function(CS) {
mx = matrix(c(0,1,2,3, 1,0,3,2, 2,3,0,1, 3,2,1,0), 4)
name = c("A","C","G","T")
dimnames(mx) = list(name, name)
BS = unlist(strsplit(CS, ""))
former = which(BS[1] == name)
for (i in 2:nchar(CS)) {
BS[i] = names(which(BS[i] == mx[former,]))
former = which(BS[i] == name)
}
paste(BS, collapse="")
}
sample01 = "C103023011232302323231301122233320313322132310333233003233231023023000231223"
answer01 = "CAATTCGGTGATCGGATCGATGCCACTCTATAGGCATAGACGATGGCGCTATTTAGCGATGGATTCGGGGATGAGC"
CS2BS(sample01) == answer01
sample02 = "G013232302011113133323231113100032313121302131301303000310323130301323123032"
answer02 = "GGTAGCTAAGGTGTGCATATCGATGTGCAAAATCGTACTGCCTGCATTGCCGGGGCAATCGTAATTGCTACTAATC"
CS2BS(sample02) == answer02