import java.util.*; public class matchseq { private String seq1 = ""; //the source sequence private String seq2 = ""; //the recognition sequence private char allele1 = ' '; private char allele2 = ' '; private int snploc = 0; private int misloc = 0; private int len1 = 0; private int len2 = 0; public matchseq (String s1, String s2, char c1, char c2, int p1, int p2) { seq1 = s1; seq2 = s2; allele1 = c1; allele2 = c2; snploc = p1; misloc = p2; len1 = seq1.length(); len2 = seq2.length(); } //a method the check whether two nucleotides match each other private boolean checksnp (char ch1, char ch2) { //ch1 is snp allele, ch2 is allele in recognition sequence if (ch1 == 'A') { if ((ch2 == 'A') || (ch2 == 'R') || (ch2 == 'H') || (ch2 == 'V') || (ch2 == 'N') || (ch2 == 'M') || (ch2 == 'W') || (ch2 == 'D')) return true; } else if (ch1 == 'T') { if ((ch2 == 'T') || (ch2 == 'K') || (ch2 == 'H') || (ch2 == 'Y') || (ch2 == 'N') || (ch2 == 'B') || (ch2 == 'W') || (ch2 == 'D')) return true; } else if (ch1 == 'G') { if ((ch2 == 'G') || (ch2 == 'R') || (ch2 == 'K') || (ch2 == 'Y') || (ch2 == 'N') || (ch2 == 'S') || (ch2 == 'B') || (ch2 == 'D')) return true; } else if (ch1 == 'C') { if ((ch2 == 'C') || (ch2 == 'H') || (ch2 == 'V') || (ch2 == 'Y') || (ch2 == 'N') || (ch2 == 'S') || (ch2 == 'B') || (ch2 == 'M')) return true; } return false; } //a method to check whether the two sequences match each other private boolean checkseq (int p) { int p1 = 0; int p2 = 0; boolean mismatchIn = false; //move backwards and compare one by one for (int i=1; i<(p+1) && i