subject

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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:50
Representa os dados de um banco de dados como uma coleç? o de tabelas constituídas por um conjunto de atributos, que definem as propriedades ou características relevantes da entidade que representam. marque a alternativa que representa o modelo descrito no enunciado. escolha uma:
Answers: 3
question
Computers and Technology, 23.06.2019 18:30
How often does colleges update the cost of attendance on their website? . a)every two years b) every four years c) every year d) every semester
Answers: 1
question
Computers and Technology, 23.06.2019 22:00
Jackson, who works in the finance department of a company, is holding a seminar for other employees on how to file taxes. only three employees sign up to attend the seminar. which device can he use to share his presentation with a group of three employees?
Answers: 1
question
Computers and Technology, 24.06.2019 18:00
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best-suited for this?
Answers: 1
You know the right answer?
6.58 programming project 2: Manipulate DNA Part A:
Given: A DNA string, s, where the alphabe...
Questions
question
Chemistry, 07.09.2021 05:20
question
Geography, 07.09.2021 05:20
question
Mathematics, 07.09.2021 05:20
question
History, 07.09.2021 05:20
question
Chemistry, 07.09.2021 05:20
question
Mathematics, 07.09.2021 05:30
question
Biology, 07.09.2021 05:30
Questions on the website: 13722367