Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer in python 2.7 please . I am really struggling with this and i really would love your help. Its due today and i am

Answer in python 2.7 please. I am really struggling with this and i really would love your help. Its due today and i am especially stuck on question 3 which builds on from the other codes like oneFrame to write working longestORF that passes the examples provided. Thank you in advance! image text in transcribed

image text in transcribed

image text in transcribed

1. Write a function called restOfORF(DNA) that takes as input a DNA sequence written 5' to 3'. It assumes that this DNA sequence begins with a start codon "ATG". It then finds the next in frame stop codon, and returns the ORF from the start to that stop codon. The sequence that is returned should include the start codon but not the stop codon. If there is no in frame stop codon, restOfORF should assume that the reading frame extends through the end of the sequence and simply return the entire sequence. To this end, you will need to determine if a particular codon is a stop codon. Imagine that you have a string named codon and you wish to test if it is a stop codon, that is one of 'TAG', 'TAA', or 'TGA'. You could do this: if codon = 'TAG or codon = TAA' or codon 'TGA': blah, blah, blah Or, better yet, you could use in this way: if codon in [TAG', TAA', 'TGA']: blah, blah, blah Here are some examples of restOfORE: >>>restOFORE("ATGTGAA") 'ATG' >>> restOfORF("ATGAGATAAG") 'ATGAGA >>> restOFORE("ATGAGATAGG") 'ATGAGA' >>> restOFORE("ATGAAATT") 'ATGAAATT 2. Next, you will write functions that can find open reading frames in sequences that don't begin with an ATG. These functions will search for ATGs and then call restOfORF to get the corresponding open reading frames. Consider some sequence of interest. Imagine we start at the 0 position and count off in units of 3 nucleotides. This defines a particular reading frame for the sequence. Here is an illustration, where alternating H+ and --- are used to indicate the units of 3 nucleotides. Paragraph Styles EAGCTCCAATGTTTTAACCCCCCCC + ---+ ---++---+ ---+ Considering just the given sequence (and not the reverse complement), we can define two other reading frames on this sequence, starting at either the l or the 2 positions, CAGCTACCATGTTTTAACCCCCCCC - --- -- -- --- CAGCTACCATGTTTTAACCCCCCCC -H --++---+ - t- Every open reading frame between an ATG and a stop must fall in one of these three reading frames. A useful way to look for genes involves searching each of these frames separately for open reading frames. one Frame 3. Write a function oneFrame(DNA) that starts at the 0 position of DNA and searches forward in units of three looking for start codons. When it finds a start codon, oneFrame should take the slice of DNA beginning with that "ATG" and ask restOIORF for the open reading frame that begins there. It should store that sequence in a list and then continue searching for the next "ATG" start codon and repeat this process. Ultimately, this function returns the list of all ORFs that it found. Here are some examples of oneFrame in action: >>> oneFrame("CCCATGTTTTGAAAAATGCCCGGGTAAA") L'ATGTTT', 'ATGCCCGGG'] >>> oneFrame("CCATGTAGAAATGCCC") >>> oneFrame("ATGCCCATGGGGAAATTTTGACCC") L'ATGCCCATGGGGAAATTT, 'ATGGGGAAATTT) 3. Next, you will write a function longestORF(DNA) that takes a DNA string, with bases written 5 to 3, and returns the sequence of the longest open reading frame on it, in any of the three possible frames. This function will not consider the reverse complement of DNA. It shouldn't take much work to write longestORE given that you've already written oneFrame Consider the one sequence example from above: >>> DNA="CAGCTCCAATGTTTTAACCCCCCCC We can look at the three frames of this sequence by slicing off 0, 1 or 2 base pairs at the start: >>> ne Frame DNA) >>> gpeFrame DNA[1:1) >>> geFrame DNA[2:D [ATGTTT) Each call to oneFrame will produce a list. You can then combine the lists from the three calls, identify the largest ORF and return it. To combine two lists, you can do the following: sss alista[1.4) > list 5,6] >>s combinedList-alist blist >>> combinedlist [1,4,5,61 Also, remember that if you have a string and want to know its length, you can use the built- in len function. Here are some examples of longestORE >> longestORECATGAAATAG') "ATGAAA >>> longestORECCATGAATAGGCCCA') "ATGAATAGGCCCA >>> longestORECCTGTAA) >> longestORECATGCCCTAACATGAAAATGACTTAGG)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Question

If find: (a) f(-2) (b) f(0) (c) f(2) if x 0 f(x) = 2x + 1 2 %3D

Answered: 1 week ago

Question

Why should an abused person talk about his or her situation?

Answered: 1 week ago