fredkneeland / DNA_Analysis

Java code for analyzing human dna
GNU General Public License v3.0
1 stars 3 forks source link

Add mistake handling to DNA pairing #5

Open fredkneeland opened 6 years ago

fredkneeland commented 6 years ago

https://github.com/fredkneeland/DNA_Analysis/blob/master/src/InverseCompliment.java#L26

You notice that when we are looking for inverse compliment pairs we have some code dummied out to handle minor errors in a long string comparison. This should be pulled out into a class called DNAComparator and then another class added for inverse compliments i.e.

class DNAComparator {
   // constants to determine the amount of error allowed in "equal" strings

  public static boolean areDNAStringsEqual(String a, String b) {
  // returns if they are equal allowing for some minor errors
}

// other helper methods for DNAStringsEqual
}

class DNAInverseComparator {
  // method to see if two strings are inverse
  public static boolean isInverse(String a, String b) {
     // find inverse compliment of a

    // use DNAComparator to see if inverse compliment of a equals b
  }
}