please code in python. Each problem will be placed in its own function. You will have a main function that calls the function for each problem. For these problems, you will need to use the following string functions: lower, upper, isupper, islower, isdigit, and replace, along with using [ ] to access individual characters. You may use other string functions if you find them useful. You will write a function named computeGCPercentage that accepts a string (representing a piece of DNA) as an input and returns a float representing the Guanine-Cytosine (GC) content percentage. For example, assume that the DNA string GTAACTAGCTTACGTAAC is entered. Because there are a total of 7 characters that are either G or C, and there are 18 characters altogether, the function should return a floating point value equivalent to 7/18 . Requirements Your function: 1. Must check to see that there are no other characters in the string other than those specified. If there is, it should print an error message and return 0. 2. Must check to make sure that the string actually has characters. If it is a zero-length string, return 0. 3. Must work correctly for both upper-case, lower-case, and mixed-case strings.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

please code in python.

Each problem will be placed in its own function. You will have a main function that calls the function for each problem. For these problems, you will need to use the following string functions: lower, upper, isupper, islower, isdigit, and replace, along with using [ ] to access individual characters. You may use other string functions if you find them useful.

You will write a function named computeGCPercentage that accepts a string (representing a piece of DNA) as an input and returns a float representing the Guanine-Cytosine (GC) content percentage.

For example, assume that the DNA string GTAACTAGCTTACGTAAC is entered. Because there are a total of 7 characters that are either G or C, and there are 18 characters altogether, the function should return a floating point value equivalent to 7/18 .

Requirements Your function:
1. Must check to see that there are no other characters in the string other than those specified. If there is, it should print an error message and return 0.
2. Must check to make sure that the string actually has characters. If it is a zero-length string, return 0.
3. Must work correctly for both upper-case, lower-case, and mixed-case strings.

Background: In molecular biology, DNA molecules are made of a number of different
nitrogenous bases. This includes adenine (A), guanine (G), thymine (T), and cytosine
(C). The letter abbreviations in the previous sentence are used to denote the composition
of a DNA molecule. For example, you might have the string TTGATCA.
The Guanine-Cytosine (GC) content percentage is a simple statistic that can be used for
describing genomes. It is simply the ratio of the occurrences of G and C in the sequence
to the number of bases present. That is:
G+C
A+T+G+ C
. where the letters above represent the counts of those bases in the string representing
the DNA.
Transcribed Image Text:Background: In molecular biology, DNA molecules are made of a number of different nitrogenous bases. This includes adenine (A), guanine (G), thymine (T), and cytosine (C). The letter abbreviations in the previous sentence are used to denote the composition of a DNA molecule. For example, you might have the string TTGATCA. The Guanine-Cytosine (GC) content percentage is a simple statistic that can be used for describing genomes. It is simply the ratio of the occurrences of G and C in the sequence to the number of bases present. That is: G+C A+T+G+ C . where the letters above represent the counts of those bases in the string representing the DNA.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY