Simple method that implements the fundamental molecular biology principle: DNA -> RNA -> Protein conversions in C++. A M1-S1 GENIOMHE exercise in Object Oriented Programming.
Go to file
Samuel Ortion b5cdf0a828 feat: Exercise considered done 2023-10-01 12:29:18 +02:00
data feat: Exercise considered done 2023-10-01 12:29:18 +02:00
include feat: Exercise considered done 2023-10-01 12:29:18 +02:00
resources feat: Exercise considered done 2023-10-01 12:29:18 +02:00
src feat: Exercise considered done 2023-10-01 12:29:18 +02:00
tests feat: Exercise considered done 2023-10-01 12:29:18 +02:00
.gitattributes feat: Exercise considered done 2023-10-01 12:29:18 +02:00
.gitignore feat: Exercise considered done 2023-10-01 12:29:18 +02:00
CMakeLists.txt feat: Exercise considered done 2023-10-01 12:29:18 +02:00
Makefile feat: Exercise considered done 2023-10-01 12:29:18 +02:00
README.md feat: Exercise considered done 2023-10-01 12:29:18 +02:00

README.md

DNA++

Instructions

  1. Create a base class Sequence that represents a generic sequence. Include the following attributes and methods:
    1. Attributes:
      1. sequence: A string representing the sequence itself.
    2. Methods:
      1. __init__(self, sequence): Initialize the sequence.
      2. get_length(self): Return the length of the sequence.
      3. get_sequence(self): Return the sequence as a string.
  2. Create a subclass DNASequence that inherits from the Sequence class. Add the following methods:
    1. get_complement(self): Return the complementary DNA sequence. A pairs with T, and C pairs with G.
    2. transcribe_to_rna(self): Return the RNA sequence by replacing all T's with U's.
  3. Create another subclass ProteinSequence that inherits from the Sequence class. Add a method translate_to_protein(self) that translates the DNA sequence into a protein sequence using the genetic code (you can use a dictionary to map codons to amino acids).
  4. Provide an example DNA sequence and demonstrate the functionality of your program by:
    1. Creating a DNA sequence object.
    2. Getting its complement and transcribed RNA sequence.
    3. Translating it into a protein sequence.

Hints:

  • You can create a dictionary to represent the genetic code, where keys are codons (triplets of nucleotides), and values are the corresponding amino acids.
  • The complement of a DNA sequence can be found by replacing A with T, T with A, C with G, and G with C.