Question: We will complete this program that requires the definition of a function named computeGCRatio to compute the GC content of a DNA molecule. Given a
We will complete this program that requires the definition of a function named computeGCRatio to
compute the GC content of a DNA molecule.
Given a single string as input where each character is one of G C T or A the GC ratio is computed as the
count of values over the total count of values. It is often written in texts as the following,
where each letter represents the count of instances in the string:
Plan:
What would be the input value parameter needed for your function to use?
What is the name of your function?
What does the function return?
How do you compute then return the ratio value?
# Lab
# PUT YOUR DEFINITION OF THE FUNCTION computeGCRatio HERE!
# Hint: your function will need counter variables one for each
# letter. And you will need to write a loop that steps through each
# character in the string
def computeGCRatio # what isare the parameters needed here?
# complete the logic here
# Main program to test the calculation
dnaFragment input Enter the DNz sequence:
gcratio computeGCRatiodnaFragment # to test your function
print For the sequence:", dnaFragment
print The GCRatio is : format gcratio
Some example data you can use to check if your
computation is correct:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
