Computers and Technology, 03.02.2022 14:00 parkermacyow71bm
6.58 programming project 2: Manipulate DNA
Part A:
Given: A DNA string, s, where the alphabet of DNA is from the set {'A','C','G','T'}
Return: Four integers (separated by spaces) counting the respective number of times that the symbols 'A', 'C', 'G', and 'T' occur in s. On the next line, a float with the CG% (which is the combined percentages of Cs and Gs in the string). The percentage is from 0 to 100 and NOT a fractional percentage.
Sample Input:
Sample Output: 25 8 16 21
34.3
Part B:
Given two strings s and t of equal length, the Hamming distance between s and t, denoted
, is the number of corresponding symbols that differ in s and t.
Given: Two DNA strings s and t of equal length .
Return: The Hamming distance $d_H(s, t)$.
1st Sample Input:
GATATCGTCTGGGACCT
CATCGCATTTACGGCCT
Sample Output:
8
2nd Sample Input:
GATATCGTCTGGGACCT
CCATCGCATTTACGGCCT
Sample Output:
Error: Sequences Length Mismatch
You need to write a function for each part.
The declarations for both functions are given in the template.
You may use more functions if you find that helpful for your implementation, but only these two will be explicitly checked.
def countBases(seq):
# return count of As, count of Cs, count of Gs, count of Ts, and Percentage of Cs and Gs combined (with 3 significant digits)
return '{:d} {:d} {:d} {:d}\n{:2.1f}'.format(A, C, G, T, cg_percentage)
def hammingdistance(seq_a, seq_b):
#return the number of differences between the two sequences
#If the sequences are not the same length, return "Error: Sequences Length Mismatch"
if __name__=="__main__":
# optional - add any test code here inside this block. we do this so that when the zyBooks tests includes
# your files to call your functions directly that the testing code in this block is not invoked
#basecount=countBases( )
pass
Answers: 1
Computers and Technology, 22.06.2019 16:30
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 2
Computers and Technology, 23.06.2019 11:30
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
Answers: 2
Computers and Technology, 23.06.2019 17:30
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ă—, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ă— slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
6.58 programming project 2: Manipulate DNA
Part A:
Given: A DNA string, s, where the alphabe...
Given: A DNA string, s, where the alphabe...
History, 27.09.2019 00:00
Mathematics, 27.09.2019 00:00
Mathematics, 27.09.2019 00:00
Spanish, 27.09.2019 00:00
Biology, 27.09.2019 00:00
Physics, 27.09.2019 00:00