Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Python Code Question #3 A DNA molecule can be specified using a string of the characters C' , G 'A,, T'. Each of these
Using Python Code
Question #3 A DNA molecule can be specified using a string of the characters C' , G 'A,, T'. Each of these characters represents one of the four nucleobases Cytosine, Guanine, Adenine, and Thymine. Consult the wikipedia page on DNA for more details. If the string sequence contains a character that is not equal to one of C' , 'G' , 'A, , T, then that character is said to be a bad base and the string sequence is said to be a bad sequence For example the string CGTTTCAAACCGGT, has no bad bases and so is not a bad sequence, while the string (CGTAacTTG#OGG has four bad bases and so is a bad sequence. Write a function bad sequence.counter that has one argument file_name that is a string. The function should return the tuple (n, m) where n is the number of bad sequences and bad bases that the file named file name con tains The file named file.name should be present in the same directory (folder) that contains your python homework3 project/files line of the file is a sequence that needs to be evaluated The function should open the file and then process it to count the . You can assume that this file is a plain text file and that each individual number of bad bases and bad sequences that it contains Once the file has been processed the function should close the file before returning the results. An empty line in the file does not count as a bad sequence, just ignore it. Also do not count any spaces that occur at the beginning or the end of a line. Do not count the end of line character, n, that occurs at the end of each line of the file as a bad base . You can use the file https: //ms.master. ca/~matt/1mp3/homework/ sequences.txt to test your code and to see what a typical file to be processed looks like. This particular file has 10 bad bases and 4 bad sequences and so bad sequence.counter('sequences.txt should return the tuple (4, 10)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started