Assignment 6
Due date: 4/26/13
Analyzing protein protein interaction data
In this assignment you will write a class that handles protein-protein interaction data and handles various types of queries. Your class, called PPI, should have the following functions (methods) associated with it:
__init__(file_name). Your constructor receives as a parameter a file name that contains a list of PPIs, which it reads and stores in a Python dictionary. The file will be comma-delimited, and each line in it will have the following format:protein_a,protein_b
This indicates thatprotein_ainteracts withprotein_b. As an example you can use the following interaction dataset: yeast interactions. This file contains 10,517 interactions in yeast extracted from the Bind database, and used in this paperinteract(id1, id2). This function receives the IDs of two proteins and returnsTrueif they appear in the given interaction dataset, andFalseotherwise. Make sure that your function returns the same value regardless of the order in which the proteins are provided.get_interactions(id). This function returns the IDs of all the proteins with which the protein with the given ID interacts with in the given interaction dataset.average_interactions(). Returns the average number of interactions per protein in the given set of interactions.__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.
Submit a module named ppi.py that contains this class and submit it via ramct.
