Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (21 sloc) 1.85 KB

Python 10 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.
You can’t perform that action at this time.