Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions