Komplement einer DNA-Sequenz

Angenommen ich habe eine DNA-Sequenz. Ich möchte das ergänzen. Ich verwendete den folgenden code, aber ich bin nicht immer es. Was mache ich falsch ?

s=readline()
ATCTCGGCGCGCATCGCGTACGCTACTAGC
p=unlist(strsplit(s,""))
h=rep("N",nchar(s))
unlist(lapply(p,function(d){
for b in (1:nchar(s)) {    
    if (p[b]=="A") h[b]="T"
    if (p[b]=="T") h[b]="A"
    if (p[b]=="G") h[b]="C"
    if (p[b]=="C") h[b]="G"
}

InformationsquelleAutor Anurag Mishra | 2013-12-04

Schreibe einen Kommentar