Question: How would I compute the AT content using the existing GC code? Thank you Part 1e: Compute AT content that, in addition to computing and

 How would I compute the AT content using the existing GC
code? Thank you Part 1e: Compute AT content that, in addition to
computing and printing the GC ratio, it also computes and prints the
How would I compute the AT content using the existing GC code? Thank you

Part 1e: Compute AT content that, in addition to computing and printing the GC ratio, it also computes and prints the AT content. The A content is the percentage of nucleotides that are A or T Two ways to compute the AT content are: Copy the existing loop that examines each base pair. You will now have two loops, one of which computes the GC count and one of which computes the AT count Add more statements into the existing loop, so that one loop computes both the GC count and the AT count You may use whichever approach you prefer. Check your work by manually computing the AT content for file test-small.fastg, then comparing it to the output of running y program on test-small.fastg Run your program on sample 1.fastq. Cut-and-paste the relevant line of output into answers.txt. seq" # The current line number (-the number of lines read so far). linenum = 0 for line in inputfile: linenum linenum + 1 # if we are on the 2nd, 6th, 10th line if linenum % 4-2: # Remove the newline characters from the end of the line line line.rstrip) seq seq line ### Compute statistics # Total nucleotides seen so far. total.count # Number of G and C nucleotides seen so far. gc-count 0 # for each base pair in the string, for bp in seq: # increment the total number of bp's we've seen total.count total.count 1 #next, if the bp is a G or a C, # increment the count of gc gc.count gc..count 1 # divide the gc-count by the total-count gc-content = float(gc-count) / total-count # Print the answer print C"GC-content:", gc.content) 1 ignore this line 2 ATCAGAACTA 3 ignore this line 4 ignore this line on

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 Databases Questions!