Hi, I am trying to learn java and would like some help in:
1.Read in a list of strings of chracters A,C,G,and T (ignoring case). Ignore the string if it contains any other character.
2.Store the strings in an array
3.Using a separate method, calculate the number of positions in each pair of sequences that have a different nucelotide (the 4.Hamming Distance)
5.Print out the maximum Hamming Distance between any two sequences
public class Hamming { /** * @return true if and only if every character in the input String s is one of a, A, c, C, g, G, t or T. * @return false if s is null or empty. */ public static boolean isDNASequence(String s) { // TODO fill in this method } /** * Get the distance matrix * * @param sequences - array of sequences * @return distance matrix */ public static int[][] getDistances(String[] sequences) { // TODO fill in this method } /** * Get the hamming distance between two string sequences * * @param sequence1 - the first sequence * @param sequence2 - the second sequence * @return the Hamming distance */ public static int getHammingDistance(String sequence1, String sequence2){ // TODO fill in this method } /** * Main method * * 1. Go through the parameters * 2. Ensure they are valid DNA sequences * 3. Get the Hamming distance matrix * 4. Print out the highest distance only * @param args - program arguments */ public static void main(String[] args) { // TODO fill in this main method code below this line } }
How can I code the program to read the arguments ignoring characters that are not A,C, T or G?