Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in java please 5. Suppose we are interested in studying a DNA sequence which consists of four bases: A,C,G, and T. For example: TGCGTGCTACCACATCATGCAGTTTTCAAAGAAGAAAGCCTCACCACAAA. (a)
in java please
5. Suppose we are interested in studying a DNA sequence which consists of four bases: A,C,G, and T. For example: TGCGTGCTACCACATCATGCAGTTTTCAAAGAAGAAAGCCTCACCACAAA. (a) Write a function of the form String getRandDNA ( int n ) which creates a random string of length n. (b) Write a function of the form int getBasecount(string dna, char base), where dna [] is a DNA string and base is a single character. The function returns how many times base occurs in the string. For example, in the above string, ' T ' occurs 10 times. Note: Here, you don't have to pass in the array dimension because you can get it from the strlen function. (c) Write a function called void printStats (String dna) that takes in the DNA string and prints the percentages to the screen in the following format: Sequence: TGCGTGCTACCACATCATGCAGTTTTCAAAGAAGAAAGCCTCACCACAAA Length: 50 Base Statistics A: 26.4 C: 44.1 G: 34.8 T: 13.6 (d) Write a function of the form String getIsolated(string dna, char base) which given a DNA string creates a new string by blanking out (convert to .) any character other than the specified base. For example, suppose base =A, then the following string will be created. dna: TGCGTGCTACCACATCATGCAGTTTTCAAAGAAGAAAGCCTCACCACAAA (e) Write a function called void viewAllisolated (String dna []) which displays all 4 isolated strings. (f) Write the function: String [] getRandDnaPopulation (int n, int pop_size) which returns an array of random DNA strings of length n. The number of DNA strings in the array is pop_size. (g) Write a function to display the population and information about the population
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started