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, 22.06.2019 05:30
Gerard is currently working as an entry-level customer support technician, but he would like to someday become a software developer. what is the best first step to understand what he should do? ask his manager for a new job or at least a job recommendation study graphic design in order to obtain the necessary skills use career resources to investigate what skills and education are required work part-time as an entry-level web developer question 13 (true/false worth 6 points) (08.03 lc) career resources are used to explore career options and find career information. true false question 14(multiple choice worth 6 points) (08.01 mc) classify the following skills: writing html code, evaluating color theory, using design principles. hard skills interpersonal skills people skills soft skills question 15 (true/false worth 6 points) (08.03 lc) a mentor is a person who is advised, trained, or counseled by a trusted mentee. true false
Answers: 2
question
Computers and Technology, 22.06.2019 07:50
In this lab, you complete a prewritten c++ program for a carpenter who creates personalized house signs. the program is supposed to compute the price of any sign a customer orders, based on the following facts: the charge for all signs is a minimum of $35.00. the first five letters or numbers are included in the minimum charge; there is a $4 charge for each additional character. if the sign is made of oak, add $20.00. no charge is added for pine. black or white characters are included in the minimum charge; there is an additional $15 charge for gold-leaf lettering. instructions ensure the file named housesign.cppis open in the code editor. you need to declare variables for the following, and initialize them where specified: a variable for the cost of the sign initialized to 0.00 (charge). a variable for the number of characters initialized to 8 (numchars). a variable for the color of the characters initialized to "gold" (color). a variable for the wood type initialized to "oak" (woodtype). write the rest of the program using assignment statements and ifstatements as appropriate. the output statements are written for you. execute the program by clicking the run button. your output should be: the charge for this sign is $82. this is the code, // housesign.cpp - this program calculates prices for custom made signs. #include #include using namespace std; int main() { // this is the work done in the housekeeping() function // declare and initialize variables here // charge for this sign // color of characters in sign // number of characters in sign // type of wood // this is the work done in the detailloop() function // write assignment and if statements here // this is the work done in the endofjob() function // output charge for this sign cout < < "the charge for this sign is $" < < charge < < endl; return(0); }
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 23.06.2019 12:30
How is the brightness of oled of the diaplay is controled
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
Biology, 01.02.2021 23:00
question
Mathematics, 01.02.2021 23:00
question
Mathematics, 01.02.2021 23:00
question
Mathematics, 01.02.2021 23:00
Questions on the website: 13722367