I have attached the assignment instructions and what was already given to us. that works with the methods
Weeks-8-9 / README.md danfdeblasio Updating README 29e6f3c 18 hours ago 1 contributor Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Dismiss Sign up master Branch: Find file Copy path 45lines(35sloc) 4.02KB Weeks 8-9 Lab In this weeks lab we will work on the computer science concepts of Linked Lists and Sorting. We will be doing this by introducing a common task in computational biology: RNA to Amino Acid translation. Proteins are encoded in a 20 letter amino acid alphabet but when those proteins are encoded on the genome they are in a 4 letter alphabet. To convert from RNA into Amino Acids your cells use a specific code to convert 3 RNA characters (called a codon) into a specific amino acid. The codon to Amino Acid map is shown in the figure below. Notice that each codon encodes only 1 Amino Acid, but each Amino Acid may corespond to multiple codon sequences. Raw Blame History https://github.com/CS2401-Spring2020/Weeks-8-9 https://github.com/danfdeblasio https://github.com/danfdeblasio https://github.com/CS2401-Spring2020/Weeks-8-9/commit/29e6f3c2f7732d5bbb994a777bb3fc3c9a9c37a5 https://github.com/CS2401-Spring2020/Weeks-8-9/commit/29e6f3c2f7732d5bbb994a777bb3fc3c9a9c37a5 https://github.com/join?source=prompt-blob-show&source_repo=CS2401-Spring2020%2FWeeks-8-9 https://github.com/CS2401-Spring2020/Weeks-8-9/find/master https://github.com/CS2401-Spring2020/Weeks-8-9#weeks-8-9-lab https://camo.githubusercontent.com/2ee9cd22d1692967cf3d29d03e00ac22b9229c6c/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f7468756d622f362f36642f524e412d636f646f6e732d616d696e6f61636964732e7376672f3130323470782d524e412d636f646f6e732d616d696e6f61636964732e7376672e706e67 https://github.com/CS2401-Spring2020/Weeks-8-9/raw/master/README.md https://github.com/CS2401-Spring2020/Weeks-8-9/blame/master/README.md https://github.com/CS2401-Spring2020/Weeks-8-9/commits/master/README.md https://desktop.github.com/ Some codons enode a "stop", which halts translation at that point. As cells evolve the RNA sequences change which may or may not change the protein sequences. Our task will be to translate two (or more) RNA sequences and compare the Amino Acid frequencies. Your task Create a new linked list type, AminoAcidLL , which holds: privatecharaminoAcid -- the character representing the Amino Acid stored in this element privateString[]codons -- the codons that represent this Amino Acid privateint[]counts -- the count of the codon usage ( codons.length will be equal to counts.length ) The methods you will need to create and manage your linked lists for each sequence are: privatevoidaddCodon(StringinCodon) -- this will (recursively) add the codon to the linked list, if the Amino Acid already exists it will add it to the count on that node, otherwise it will create a new node. privatevoidtotalCount() -- this will return the number of times this amino acid is used in the sequence (the sum of all of the codon counts). publicintaminoAcidCompare(AminoAcidLLinList) -- this is a recursive method that returns the difference in counts between two lists of Amino Acids (using the totalCount() value). publicintcodonCompare(AminoAcidLLinList) -- this is a recursive method that returns the difference in counts between the two lists of Amino Acids based on the individual codon counts (while the totalCount() difference may be 0, the codon difference may be non-zero). publicchar[]aminoAcidList() -- returns an array of the amino acids characters (in the order which they are in within the linked list). publicint[]aminoAcidCounts() -- returns an array of the counts of the amino acids (in the order which they are in within the linked list). https://github.com/CS2401-Spring2020/Weeks-8-9#your-task https://github.com/CS2401-Spring2020/Weeks-8-9/blob/master/images/codon.jpg privatebooleanisSorted() -- a recursive method that determines if the remainder of a given linked list is already sorted. Your class will also have several static methods that are used to construct and sort a linked list publicstaticAminoAcidLLcreateFromRNASequence(StringinSequence) -- this will take in the RNA sequence and return the linked list containing only the Amino Acids present in the seuqnece, with the codon counts propigated. Note that the STOP codon does not actually exist in the list, but indicates when translation should stop (this may come before the end of the string). privatevoidsort(AminoAcidLLinList) -- sorts the given linked list by the Amino Acid character in alphanumeric order. Given You will be provided with a java class AminoAcidResources.java (it is already in your repository) which will have the following methods: publicstaticchargetAminoAcidFromCodon(Strings) -- given a String with 3 characters, returns the Amino Acid character. If the codon is invalid the method will return NULL. If the codon is a STOP, the method will return * . publicstaticString[]getCodonListForAminoAcid(chara) -- given an Amino Acid character, returns an array of all possible codons as strings. If the character is not an AminoAcid, the method will return an empty array. What to turn in \. AminoAcidLL.java ]. AminoAcidLLTester.java -- contains at least 10 test cases testing the methods above. https://github.com/CS2401-Spring2020/Weeks-8-9#given https://github.com/CS2401-Spring2020/Weeks-8-9#what-to-turn-in class AminoAcidResources{ public static char getAminoAcidFromCodon(String s){ //if this is not a 3 character string, return NULL if(s.length()!=3) return (char)0; s = s.toUpperCase(); if(s.charAt(0) == 'A'){ if(s.charAt(1) == 'A'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G') return 'K'; if(s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'N'; } if(s.charAt(1) == 'C'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G' || s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'T'; } if(s.charAt(1) == 'G'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G') return 'R'; if(s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'S'; } if(s.charAt(1) == 'U'){ if(s.charAt(2) == 'G') return 'M'; if(s.charAt(2) == 'A' || s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'I'; } } if(s.charAt(0) == 'C'){ if(s.charAt(1) == 'A'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G') return 'Q'; if(s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'H'; } if(s.charAt(1) == 'C'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G' || s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'P'; } if(s.charAt(1) == 'G'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G' || s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'R'; } if(s.charAt(1) == 'U'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G' || s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'L'; } } if(s.charAt(0) == 'G'){ if(s.charAt(1) == 'A'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G') return 'E'; if(s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'D'; } if(s.charAt(1) == 'C'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G' || s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'A'; } if(s.charAt(1) == 'G'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G' || s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'G'; } if(s.charAt(1) == 'U'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G' || s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'V'; } } if(s.charAt(0) == 'U'){ if(s.charAt(1) == 'A'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G') return '*';//STOP if(s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'T'; } if(s.charAt(1) == 'C'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G' || s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'S'; } if(s.charAt(1) == 'G'){ if(s.charAt(2) == 'A' ) return '*'; //STOP if(s.charAt(2) == 'G') return 'W'; if(s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'C'; } if(s.charAt(1) == 'U'){ if(s.charAt(2) == 'A' || s.charAt(2) == 'G') return 'L'; if(s.charAt(2) == 'C' || s.charAt(2) == 'U') return 'F'; } } // If we ended up not finding all 3 characters, return NULL return (char)0; } public static String[] getCodonListForAminoAcid(char a){ a = Character.toUpperCase(a); if(a == 'A') return new String[]{"GCG","GCA","GCC","GCU"}; else if(a == 'C') return new String[]{"UGC","UGU"}; else if(a == 'D') return new String[]{"GAC","GAU"}; else if(a == 'E') return new String[]{"GAG","GAA"}; else if(a == 'F') return new String[]{"UUC","UUU"}; else if(a == 'G') return new String[]{"GGG","GGA","GGC","GGU"}; else if(a == 'H') return new String[]{"CAC","CAU"}; else if(a == 'I') return new String[]{"AUA","AUC","AUU"}; else if(a == 'K') return new String[]{"AAG","AAA"}; else if(a == 'L') return new String[]{"CUG","CUA","CUC","CUU","UUG","UUA"}; else if(a == 'M') return new String[]{"AUG"}; else if(a == 'N') return new String[]{"AAC","AAU"}; else if(a == 'P') return new String[]{"CCG","CCA","CCC","CCU"}; else if(a == 'Q') return new String[]{"CAG","CAA"}; else if(a == 'R') return new String[]{"AGG","AGA","CGG","CGA","CGC","CGU"}; else if(a == 'S') return new String[]{"AGC","AGU","UCG","UCA","UCC","UCU"}; else if(a == 'T') return new String[]{"ACG","ACA","ACC","ACU","UAC","UAU"}; else if(a == 'V') return new String[]{"GUG","GUA","GUC","GUU"}; else if(a == 'W') return new String[]{"UGG"}; // if character passed is not an amino acid, return an empty array return new String[]{}; } }