Question: Design a Java class names DnaSequenceOperations, which should contain these static methods: - public static String complementarySequence(String initialDnaSequence) which returns the complementaty DNA sequence of

Design a Java class names DnaSequenceOperations, which should contain these static methods:

- public static String complementarySequence(String initialDnaSequence) which returns the complementaty DNA sequence of the given DNA sequence. For example if the input is TCCAGTTACGC, the output should be: AGGTCAATGCG - public static char mostFrequentBase(String dnaSequence) which finds the most frequent base (i.e. the base that has the largest number of appearances). For example if the input is TCCAGTTACGC, the output should be: C. (In case of equal frequencies, you may return any of the bases having the same frequency). - public static String insert(String initialDnaSequence, String sequenceToInsert, int position) which returns a DNA sequence formed by inserting the given sequence in the given initial DNA sequence. For example if the input consists of TCCAGTTACGC (as the initial sequence), GATCGA (as the sequence to insert) and 7 (as the position), then the output should be: TCCAGTTGATCGAACGC. -public static String remove(String initialDnaSequence, String patternToRemove) which returns a DNA sequence formed by removing the first occurrence of the given DNA pattern from the initial DNA sequence. -public static String decompress(String compressedDnaSequence) which forms a standard DNA sequence from a compressed sequence. A compressed DNA sequence may have numbers and brackets which show how many times the preceding token is repeated. For example, if the compressed sequence is AD3CTG4AC(DAG)3CT2A, then the result (the standard DNA sequence) will be: ADDDCTGGGGACDAGDAGDAGCTTA. For simplicity, just consider the cases without nesting

PLEASE EXPLAIN YOUR CODE ! ! !

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!