Question: Your code: 1 . Create a function called load _ data. a . It takes as argument the name of the file to be used

Your code:
1. Create a function called load_data.
a. It takes as argument the name of the file to be used (a string).
b. It returns a data structure (or more than one) that contains all of the information from the input file.
2. Create a function called count_nucl_freq.
a. It takes as argument the data structure(s) generated by load_data.
b. It returns a new data structure (or more than one) that contains the frequencies of the nucleotides for each column in each sequence.
3. Create a function called find_consensus.
a. It takes as argument the data structure(s) generated by count_nucl_freq.
b. It returns a string; the consensus sequence.
4. Create a function named process_results.
a. It takes as arguments the data structure(s) created by count_nucl_freq and the name of the output file (a string).
b. It writes the results, in the format previously described, to the output file.
c. It doesnt return anything.
Other Important information
1. Sample files are provided, but they are for testing purposes only. In other words, the sample DNAOutput.txt provided should be the result of executing your program with the sample file provided (DNAInput.fasta or DNAInput.txt). Your program should be able to work with any FASTA file where all sequences are of the same length.
2. You should NOT prompt for the file name; you should ALWAYS try to open a file named DNAInput.txt and your output should ALWAYS be to a file named DNAOutput.txt.
You may assume that:
Every combination of description+sequence takes up 2 lines (1 line for each).
All sequences in the file have the same length. The exact length is not initially known; you may determine it from any of the sequences.
All nucleotides are in capital letters.
There will be no characters other than A, C, T, and G in the sequences.
There will be no ties for the most highly-occurring nucleotide in any column. This means that, when determining the consensus, there will be a single nucleotide that is the highest occuring.

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