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

We have a random DNA sequence, and we want to find the closest species to it. s

ID: 3873278 • Letter: W

Question

We have a random DNA sequence, and we want to find the closest species to it. s the DNA sequence more similar to human, mouse, or unknown? When could this kind of comparison be useful? Suppose that the emergency room of some hospital sees a sudden and drastic increase in patients presenting with a particular set of symptoms. Doctors determine the cause to be bacterial, but without knowing the specific species involved they are unable to treat patients effectively. One way of identifying the cause is to obtain a DNA sample and compare it against knowrn bacterial genomes. With a set of similarity scores, doctors can then make more informed decisions regarding treatment, prevention, and tracking of the disease The goal of this part of the assignment is to write functions that can be useful to determine the identity of different species of bacteria, animals, etc . By simply using the similarity score routine you implemented you can compare an unknown sequence to different genomes and figure out the identity of the unknown sample float findBestMatch(string genome, string seq) The findBestMatch function should take two string arguments and return a floating point value of the highest similarity score found for the given sequence at any position within the genome. In other words, this function should traverse the entire genome and find the highest similarity score by using similarityScore0 for the comparisons between seq and each sequential substring of genome

Explanation / Answer

Answer: See the code below

1. findBestMatch() function: See the code below:

------------------------------------------

//function to find highest similarity score found for
//given sequence at any position within the genome.
float findBestMatch(string genome, string seq)
{
   float bestMatch = 0.0; //best match score
   int genomeLength = genome.length(); //length of genome
   //loop to traverse gnome string character by character
   for(int i=0;i<genomeLength;i++)
   {
       //substring of genome to compare with sequence
       string genomeSubStr = genome.substr(i);
       //check similarity of genome substring with sequence
       float score = similarityScore(genomeSubStr,seq);
       //check score with previous best match
       if(score > bestMatch)
       {
           bestMatch = score;
       }
   }
   return bestMatch;
}

-------------------------------------

2. findBestGnome() function: See the code below:

-------------------------------------------

//function to return which genome string out of 3 (mouse genome, human genome, unknown genome)
//had highest similarity score with the given sequence
int findBestGenome(string genome1, string genome2, string genome3, string seq)
{
   //match with mouse genome
   float similarityWithMouseGenome=findBestMatch(genome1,seq);
   //match with human genome
   float similarityWithHumanGenome=findBestMatch(genome2,seq);
   //match with unknown genome
   float similarityWithUnknownGenome=findBestMatch(genome2,seq);
   //check for best genome
   if(similarityWithMouseGenome > similarityWithHumanGenome)
   {
       if(similarityWithMouseGenome > similarityWithUnknownGenome)
       {
           return 1; //mouse genome best genome
       }
       else
       {
           return 3; //unknown genome best genome
       }
   }
   else if(similarityWithHumanGenome > similarityWithUnknownGenome)
   {
       return 2; //human genome best genome
   }
   else
   {
       return 3; //unknown genome best genome
   }
   return 0; //possibly a tie
}

-------------------------------------------

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote