If/endif statement stops in middle
Posted: Mon Jan 03, 2005 11:20 pm
im trying to examine a string of DNA nucleotides and then translate that to the abbreviations for the corresponding amino acid but the if elseif statement dies a little more than halfway through:
any ideas on what is going on?????
Code: Select all
Procedure.s TranslateDNA(sequence$)
type=FindString(sequence$, "ATG", 1)
If type=1
Trimresult$ = RemoveString(sequence$," ")
Length1 = Len(Trimresult$)
For a=1 To Length1 Step 3
char1$ = Mid(Trimresult$, a, 3)
If char1$="GCT" Or char1$="GCC" Or char1$="GCA" Or char1$="GCG"
compliment$="Ala-"
ElseIf char1$="TGT" Or char1$="TGC"
compliment$="Cys-"
ElseIf char1$="GAT" Or char1$="GAC"
compliment$="Asp-"
ElseIf char1$="GAA" Or char1$="GAG"
compliment$="Glu-"
ElseIf char1$="TTT" Or char1$="TCC"
compliment$="Phe-"
ElseIf char1$="GGT" Or char1$="GGC" Or char1$="GGA" Or char1$="GGG"
compliment$="Gly-"
ElseIf char1$="CAT" Or char1$="CAC"
compliment$="His-"
ElseIf char1$="ATT" Or char1$="ATC"
compliment$="Ile-"
ElseIf char1$="AAA" Or char1$="AAG"
compliment$="Lys-"
ElseIf char1$="CTT" Or char1$="CTC" Or char1$="CTA" Or char1$="CTG"
compliment$="Leu-"
ElseIf char1$="ATG"
compliment$="Met-"
ElseIf char1$="AAT" Or char1$="AAC"
compliment$="Asn-"
ElseIf char1$="CCT" Or char1$="CCC" Or char1$="CCA" Or char1$="CGG"
compliment$="Pro-"
ElseIf char1$="CCA" Or "CAG"
compliment$="Gln-" ;;;HERE IS THE DIE POINT
ElseIf char1$="AGA" Or char1$="CGT" Or char1$="CGC" Or char1$="CGA" Or char1$="CGG"
compliment$="Arg-"
ElseIf char1$="TCT" Or char1$="TCC" Or char1$="TCA" Or char1$="TCG"
compliment$="Ser-"
ElseIf char1$="ACT" Or char1$="ACC" Or char1$="ACA" Or char1$="ACG"
compliment$="Thr-"
ElseIf char1$="GTT" Or char1$="GTC" Or char1$="GTA" Or char1$="GTG"
compliment$="Val-"
ElseIf char1$="TGG"
compliment$="Trp-"
ElseIf char1$="TAT" Or char1$="TAC"
compliment$="Tyr-"
EndIf
cstrand$=cstrand$+compliment$
Next
ProcedureReturn cstrand$
EndIf
EndProcedure