DNA Sequencing

Hello everyone!
I’ve started this project in Java and I think there might be a slightly problem with the written instructions.
It has said that a DNA sequence needs:
Start with ATG
End with TGA
All the substrings in the middle divided by 3.

So why in the instruction they said that the variable start (which is equal to a DNA string at the index of where “ATG” is located…) All good so far but in the if condition they said if (start != -1) which is not quite true because the substring “ATG” can be in another place such as from the 5th char so this condition doesn’t make any sense logically…

Would love to hear from you what you are thinking about this.

start != -1 just means that the start codon “ATG” is present somewhere in the String. if start was 5, start != -1 is still true. The start codon does not need to be at the beginning of the DNA strand. It needs to be at the beginning of a protein, which is a sub-strand of DNA. It could be at the beginning, like in the example they give, but that’s not necessary.

Oh now im understanding! I dont think they mentioned that the specific strings can be anywhere in the whole string I thought it must start and end with specific string… thanks!!

1 Like