HW 11 Take the class and function definitions from the Lecture 20 notebook (you can use the answer key versions from Canvas) and put them in a .py file. Then, do the following: 1) Re-write...

Read the assignment, HW 11 and 12 need to be done by wed dec 1st and done in anaconda navigator and saved as .py files. I can even copy and paste your code because I need to be the author of the assignment. Plz do not use advanced functions it has to be directly what my proffesor has taught. I attached Jupiter notebook downloads- can only be opened through Jupyter- In Anaconda. This should help u copy the code for the first assignment.


HW 11 Take the class and function definitions from the Lecture 20 notebook (you can use the answer key versions from Canvas) and put them in a .py file. Then, do the following: 1) Re-write file_reader() to be able to handle FASTA files that have sequences that span multiple lines, instead of having just one line of sequence for each entry. 2) Write a third function called reverse_printer() that takes as an argument a list of sequence objects and prints out on one line the sequence id, and on the second line, the reverse complement of each sequence. 3) Modify main() to remove any print statements. Instead, main() should pass the list of sequences returned by file_reader to reverse_printer(). Save the complete class and function definitions in a file called HW_11.py and turn it in by Sunday 11/28 at midnight. You can see any example of what your terminal output should look like here: HW 12 Create a new .py file named HW_12.py that contains just the class definition for Sequence(), from the Lecture 20 Workshop notebook but none of the above functions. Add a new method to the Sequence class called gene_translation() that: 1) Calls the start() method to identify whether a start codon is present in a DNA sequence 2) If start() returns True, converts a DNA sequence to RNA by calling the to_rna()method. If start() returns False, then the method prints 'Sorry, no gene in this sequence' and stops running. 3) Slices the RNA sequence to begin at the start codon 'AUG'. 4) Generates a list of codons beginning with 'AUG' and continuing every three nucleotides until the end of the sequence. So the sequence 'AUGAGGACC'would generate the list ['AUG', 'AGG', 'ACC']. 5) Slices that list to contain everything from index 0 through the first occurrence of one of the following three stop codons: 'UAG', 'UAA', or 'UGA'. Hint: There are lot of ways you can find the first stop codon. I would probably use a list comprehension to make a list of all indices where those stop codons appear: [i for i in range(len(mylist)) if mylist[i] in ['UAG', 'UAA', 'UGA']] and slice my list up to and including the first index number in the resulting list. 6) Makes use of the dictionary given in the Lecture 20 Workshop to translate each triplet into the corresponding amino acid sequence and prints the translation to the terminal as a single string. This method should require no arguments aside from self and returns nothing (just prints the amino acid sequence to the terminal). After the end of the class definition, create a main() function that reads the file cyto_pol.fasta (containing the DNA sequence for the Human Cytomegalovirus polymerase gene), extracting the sequence id and the sequence, and then instantiates a Sequence object. Note that the sequence spans multiple lines of the fasta file, but the file only contains the one sequence entry. main() should then call gene_translation() on that Sequence object. Submit your file as HW_12.py by midnight on Sunday 11/28.
Nov 28, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here