Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.87 KB

Python_11_problemset.md

File metadata and controls

34 lines (21 loc) · 1.87 KB

Python 11 Problem Set -- Classes

  1. Create a DNA sequence class that will contain a sequence, its name, and it's organism of origin. Do this by creating an __init__ function.

  2. Write some some lines of code, outside your class (in your main program) that sets the name, DNA sequence, and organism for a gene.

  3. Write some some lines of code, outside your class that:
    a. uses the object sequence attribute to retrieve and print the sequence.
    b. uses the object name attribute to retrieve and print the name.
    c. uses the object organism attribute to retrieve and print the organism.

  4. Sequence length method
    a. Add a method to your class that caclulates and returns the length of the sequence.
    b. Write some some lines of code, outside your class (in your main program) that gets and prints the sequence length using your new method.

  5. Nucleotide composition method
    a. Add in a method that caclulates and returns the nucleotide composition.
    b. Write some some lines of code, outside your class (in your main program) that gets and prints the sequence nucleotide compositio using your new method.

  6. GC content method
    a. Add in a method that caclulates and returns the GC content.
    b. Write some some lines of code, outside your class (in your main program) that gets and prints the sequence GC content using your new method.

  7. FASTA Formatter method
    a. Add in a method that returns the sequence record in FASTA format.
    b. Write some some lines of code, outside your class (in your main program) that gets and prints the sequence in FASTA format using your new method.

Challenge Question

  1. Create a method that can compare two DNA Sequence records and returns True if they are the same or False if they are differet. Sameness is based on name, organism, and seqeunce. All need to be the same for two objects to be considered the same.