Question: NucParams class q , init q , The constructor of the class has one optional parameter, a sequence of type string. It may include upper

NucParams class
q, init q,
The constructor of the class has one optional parameter, a sequence of type string. It may include upper or lower case letters of the set {ACGTUN} or whitespace. These will be gene sequences and they begin in frame 1. In other words the first 3 letters of the sequence encode the first AA of the sequence. Carefully consider in what form this class should maintain its data. Is a string the best structure? This class (NucParams) is intended to be very similar to ProteinParam. Make sure to read addSequence( before making this decision, and remember that objects of this class may need to handle an arbitrarily large number of sequences (hint: dictionaries are good). As a second hint, notice that init and addSequence are doing VERY similar things - you could just make one of them do most of the work.
addSequence()-5 pts
This method must accept new sequences, from the {ACGTUN} alphabet, and each sequence can be presumed to start in frame 1. This data must be added to the data that you were given with the init method (if any).
aaComposition()-6 pts
This method will return a dictionary of counts over the 20 amino acids and stop codons. This dictionary is VERY similar to the lab 3 aaComposition, though you must decode the codon first. The translation table from codon to AA is provided. You are counting amino acids by translating from the proper codon table.
nucComposition()-10 pts
This method returns a dictionary of counts of valid nucleotides found in the analysis. (ACGTNU). If you were given RNA nucleotides, they should be counted as RNA nucleotides. If you were given DNA nucleotides, they should be counted as DNA nucleotides. Any N bases found should be counted also. Invalid bases are to be ignored in this dictionary.
codonComposition()-10 pts
This dictionary returns counts of codons. Presume that sequences start in frame 1, accept the alphabet {ACGTUN} and store codons in RNA format, along with their counts. Any codons found with invalid bases should be discarded. Discard codons that contain N bases. This means that all codon counts are stored as RNA codons, even if the input happens to be DNA. If you discard a codon, make sure to not alter the frame of subsequent codons.
NucParams class q , init q , The constructor of

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!