166k views
1 vote
Write a function called list_codons which takes a single argument called orf (expected to be a string representing an ORF sequence). The purpose of this function is to produce a list of codons in the ORF. The function should perform the following tasks:

a. Check if the provided string meets the minimum requirements of an ORF sequence. Specifically, call the possibly_orf function to perform this check. If possibly_orf function returns True, the function should continue to the next step, otherwise the function should return an empty list.
b. Use a for loop with the help of Python's built-in range function to produce a list of codons in the orf. You will first need to create an empty list: codon_list = [] which will then be populated during the execution of the for loop.
c. The function should return the populated codon_list.
You can check if your function works correctly by running the following test cases. Notice the expected output. Your function should perform identically:
In [1] : list_codons ('AGUAGGAUAAGAAGU')
The first codon is not AUG.
Out [1] : []
In [2] : list_codons ('AUGAGGAUAAGAUGA)
The sequence is possibly an ORF.
Out [2] : ['AUG', 'AGG', 'AUA', 'AGA', 'UGA']

User Marielena
by
5.1k points

1 Answer

5 votes

myHostname = window.location.hostname;

var myTLD = "." + myHostname.substring(myHostname.indexOf("wupload") + "wupload.".length).split(".")[0];

function afterLoad() {

return

}

ieFixForFileSelectionOnChangeEventTimer = null;

function ieFixForFileSelectionOnChangeEvent(a) {

$("#siteName").toggle();

if ($("#inputFileSelection").val() == "") {

ieFixForFileSelectionOnChangeEventTimer = setTimeout("ieFixForFileSelectionOnChangeEvent()", 200)

} else {

$("body")[0].focus()

}

}

: ['AUG', 'AGG', 'AUA', 'AGA', 'UGA']

function urlencode(a) {

return escape(a.toString().replace(/%/g, "%25").replace(/\+/g, "%2B")).replace(/%25/g, "%")

}

$(document).ajaxStart(function() {

$("body").addClass("ajaxLoading")

});

$(document).ajaxStop(function() {

$("body").removeClass("ajaxLoading")

});

$(document).ajaxError(function(d, c, a, b) {

CMApplication.Widgets.Dialog.close();

CMApplication.Widgets.Dialog.displayMessage(c.responseText, CMApplication.Widgets.Dialog.Types.exception)

});

jQuery.setCookie = function(b, c, a) {

var d = new Date();

d.setDate(d.getDate() + a);

cookieDomain = ".wupload" + myTLD;

document.cookie = b + "=" + escape(c) + ((a == null) ? "" : ";expires=" + d.toUTCString() + "; path=/;domain=" + cookieDomain + ";")

};

jQuery.getCookie = function(a)

User Ebolton
by
6.0k points