Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m trying to to figure out an algorythym for a dna sequence. For example the s

ID: 3767144 • Letter: I

Question

I'm trying to to figure out an algorythym for a dna sequence.

For example the sequence is like this: GGGGATCCGGGATAGGATTCGGAGGCCCTGGGCCCTGGGCCCCGG (which is a string)

searching the the string there has to be found 2 GG high sequences which looks like the picture.

GG high sequence means in a set there are 4 couples of GG's.

http://bioinformatics.ramapo.edu/QGRS/index.php

for (i = 0 ; i < length ; i++){

    if(string[i] == "G" && string[i++] == "G" ){
     counterG++;
    }
    if(counterG == 4){
    numQuad++;
    }

Note: This is in javascript but it's not really important, I need psuedo code.

Thank you!

GGGGATCCGG GATAGGATTC GGAGGCCCTG GGCCCTGGGC cccGG

Explanation / Answer

This below psedo code to easily understand the above given for loop logic to find the given condition output..

It is in easy english language to understand of each step..as in problem statement asked only psedo code..I written only that..Please find the below and let me know

Start
Declarations
num i,length,counterG,numQuad
char string
Initialization
string = "GGGGATCCGGGATAGGATTCGGAGGCCCTGGGCCCTGGGCCCCGG"
counterG = 0
numQuad = 0
length = length(string)
For each Integer i in length of string do:
   If string[i] == "G" and string[i++] == "G" do:
       Increment counterG
   endif
   if counterG == 4 do:
       Increment numQuad
   endif
   in
endFor