Question: or this question, you will write a program that takes a sequence ( or any string ) and calculates the GC content ( as a

or this question, you will write a program that takes a sequence (or any string) and calculates the GC
content (as a percentage). The result of this calculation will then be displayed to the canvas.
You will test your program with three sequences which can be found in a4q2_files.zip:
1. sequence1.txt (a small region of the dog Leptin gene)
2. sequence2.txt (the human Sonic Hedgehog gene)
3. sequence3.txt (the entire Ebola genome).
This program is non-interactive, so you wont need functions like setup() or draw().
Here are the specifications for this problem:
For the purpose of this question, do not worry about ensuring only A,T,C, and G characters are
present in the input sequence. This sequence could (in theory) be any string but only count the G
and C characters.
Hard-code the input sequence as a string literal at the beginning of your program. To do this, define
a variable and assign it the value of one of the sequences from the files in a4q2_files.zip. Since
we havent covered file input/output yet just copy-and-paste the sequence from the file into your
program.
Use a for-loop to count the number of G and C characters in the input sequence using the variable
you defined at the top of your program.
After the for-loop calculate what percent of characters in the string were G and C(hint: you might
want to use the len() function)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!