Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DNA carries genetic instructions for the development, functioning, growth, and reproduction of all known organisms and many viruses. In this homework, you will perform basic

image text in transcribed
image text in transcribed
DNA carries genetic instructions for the development, functioning, growth, and reproduction of all known organisms and many viruses. In this homework, you will perform basic operations on DNA codons, such as generating random DNA sequences, extracting index(es) of the desired nucleotide(s), and removing the invalid ones. Below are the detailed instructions for the functions you should write. 1. generate_random_codons ( n, nuc_list) This function requires two parameters: n : The number of codons to randomly generate nuc_list: A nucleotide list that contains characters of nucleotides desired, such as [A,,C,,T,GG] This function will randomly select the characters in the nuc_list to construct DNA codons (length =3 ) n times, store them in the list, and return the list. 2. remove_invalid (codon_list, invalid_codons) This function requires two parameters: codon_list: A list of codons that the invalid codons will be removed from invalid_codons: This is a list which includes invalid codons. While writing your program, use the following invalid codon list: invalid_codons = ['GGA','GGT',GGG','GGC ',GCA', 'GCT,'GCC ,'GCG'] The function first asks to the user if (s)he wants to remove the invalid codons. If the answer's first letter is " y " or " Y ", the function removes the invalid codons from the list (if there is any). If there is no invalid codon in the list, print a message accordingly. The function also shows how many codons are removed. Then, the updated list must be returned by the function. 3. extract_seq_index (codon_list, desired_seq) This function requires two parameters: codon_list: A list of codons that a desired codon's index is extracted from desired_seq: Nucleotide(s) that will be searched in the codon list This function takes a list of codons and retums the list of index(es) of the desired nucleotide(s). 4. main 0 - Firstly, nucleotide list must be defined ([ A,C,T,G] ). - Get from the user an integer input: the number of random codons. - Generate the random codon list by calling generate_random_codons function. - Ask if the user wants to remove the invalid codons. If invalid codons exist and the user wants to remove them, they are removed from randomly created list. And the number of codons removed is printed. - Then, the desired nucleotide sequence is asked to the user and if it is found in the list, the function prints the list of index(es). Here you need to use updated list (the list after you remove the invalid ones). Sample Outputs (to get the same outputs, use random.seed(199) in your code)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions