Task 10: More fun with DNA¶
Task 10a: More Details¶
DNA is made up from two strands: the template strand and the coding strand. What we have currently stored in our sample is the template strand. The coding strand is the element-wise inverse of the template strand, where
- A is inverse to T
- C is inverse to G
so for a template strand
AACGGT the coding strand would be
Add the methods
coding_strand(self) to the
They each return the respective sequence as a string.
Do not introduce a new attribute.
Bonus: Discuss benefits and drawbacks for introducing a new attribute to store the coding strand.
Task 10b: Cleanup¶
By now we have strewn a lot of implicit information about how DNA works across all parts of our model. Make suggestions how to clean up our code.
- Which benefits would you expect from your suggestion?
- Which model elements would have to be changed and how?