Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com... Nieminen Dirk Roose Tamar Schlick Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com...
Trang 1Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 3Texts in Computational Science
Editors
Timothy J Barth
Michael Griebel
David E Keyes
Risto M Nieminen
Dirk Roose
Tamar Schlick
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 5Hans Petter Langtangen
A Primer on Scientific
Programming
with Python
Third Edition
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 6Consider the function get_base_counts(dna) (from Chapter 6.6.3),
which counts how many times A, C, G, and Tappears in the string dna:
Unfortunately, this function crashes if other letters appear in dna.
Write an enhanced function get_base_counts2which solves this
prob-lem Test it on a string like ’ADLSTTLLD’ Name of program file:
def get_base_counts(dna):
counts = {’A’: 0, ’T’: 0, ’G’: 0, ’C’: 0}
for base in dna:
counts[base] += 1 return counts
Exercise 6.32 Find proportion of bases inside/outside exons.
Consider the lactase gene as described in Chapters 6.6.4and 6.6.5
What is the proportion of base A inside and outside exons of the
lac-tase gene? Write a functionget_exons, which returns all the substrings
of the exon regions concatenated, and a function get_introns, which
returns all the substrings between the exon regions concatenated The
function get_base_frequencies from Chapter 6.6.3 can then be used
to analyze the frequencies of bases A, C, G, and T in the two strings