Main.Lab11 History

Hide minor edits - Show changes to markup

April 18, 2013, at 02:21 PM MST by 129.82.44.223 -
Deleted lines 21-34:

Protein interaction database

Convert the code you submitted into a class called PPI_database. This class should support the following methods:

  • The constructor should take as its parameter a file name and construct an interaction dataset out of the interactions in the file. It should work as load_interactions in assignment 9.
  • interact, get_interactions, and average_interactions should work as in assignment 9.
  • __repr__ should provide useful information about the dataset: the file from which it was read and how many interactions are in the dataset.
  • __len__ returns the number of interactions in the dataset.

Put the class in a file called ppi_database.py

April 18, 2013, at 02:21 PM MST by 129.82.44.223 -
Changed lines 1-5 from:

Assignment 10

Object oriented programming

In this assignment you will convert code you wrote in earlier assignments into object oriented programs.

to:

Lab 11

April 04, 2010, at 10:56 AM MST by 71.196.160.210 -
Changed lines 7-8 from:

DNA sequence object

to:

DNA sequence class

Added lines 17-18:
  • __repr__() this method should provide useful information about the sequence (e.g. its length).
Added lines 25-39:

Put the class in a file called dna_sequence.py.

Protein interaction database

Convert the code you submitted into a class called PPI_database. This class should support the following methods:

  • The constructor should take as its parameter a file name and construct an interaction dataset out of the interactions in the file. It should work as load_interactions in assignment 9.
  • interact, get_interactions, and average_interactions should work as in assignment 9.
  • __repr__ should provide useful information about the dataset: the file from which it was read and how many interactions are in the dataset.
  • __len__ returns the number of interactions in the dataset.

Put the class in a file called ppi_database.py

April 03, 2010, at 02:03 PM MST by 71.196.160.210 -
Added lines 1-22:

Assignment 10

Object oriented programming

In this assignment you will convert code you wrote in earlier assignments into object oriented programs.

DNA sequence object

Write a class called dna_sequence that represents the data and operations that can be applied to a DNA sequence.

Here is the interface that your class should support:

  • The constructor should receive a string as its parameter and interpret it as a DNA sequence. It should check that the string represents a valid DNA sequence, and raise a ValueError exception if it doesn't. For our purposes let's assume a DNA sequence can have one of the five letters A,C,G,T,N.
  • __len__() this method should return the length of the sequence. This allows the len function to be called on an instance of a dna_sequence.
  • gc_content() this method should return the fraction of nucleotides that are either G or C.
  • nucleotide_composition() this method should return a list with four elements that represent the fraction of A,C,G, and T nucleotides in the sequence (N's should be ignored as we did before).
  • reverse_complement() this method should return an instance of the class dna_sequence whose sequence is the reverse-complement.