Main.Assignment6 History
Hide minor edits - Show changes to markup
average_interactions(). Returns the average number of interactions over all proteins in the given set of interactions.
average_interactions(). Returns the average number of interactions per protein in the given set of interactions.
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. Extra credit will be given to an implementation in which this function in constant time regardless of the number of proteins in the dataset. For our purposes assume that accessing an element in a dictionary takes constant time regardless of the number of elements in the dictionary (this actually holds under certain conditions).
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.
interact(id1, id2). This function receives the IDs of two proteins and returnsTrueif they appear in the given interaction dataset, andFalseotherwise.
interact(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.
interact(id1, id2, interactions). This function receives the IDs of two proteins and returnsTrueif they appear in the given interaction dataset, andFalseotherwise.get_interactions(id, interactions). This function returns the IDs of all the proteins with which the protein with the given ID interacts with in the given interaction dataset. Extra credit will be given to an implementation in which this function in constant time regardless of the number of proteins in the dataset. For our purposes assume that accessing an element in a dictionary takes constant time regardless of the number of elements in the dictionary (this actually holds under certain conditions).average_interactions(interactions). Returns the average number of interactions over all proteins in the given set of interactions.
Submit a module named ppi.py that contains this class and submit it via ramct.
interact(id1, id2). This function receives the IDs of two proteins and returnsTrueif they appear in the given interaction dataset, andFalseotherwise.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. Extra credit will be given to an implementation in which this function in constant time regardless of the number of proteins in the dataset. For our purposes assume that accessing an element in a dictionary takes constant time regardless of the number of elements in the dictionary (this actually holds under certain conditions).average_interactions(). Returns the average number of interactions over all proteins 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.
Assignment 9
Due date: 4/5/10
Handling protein protein interaction data
In this assignment you will write several functions that load a dataset of protein-protein interactions, and enable a user to query the data. The functions you need to write are:
load_interactions(file_name). This function receives as a parameter a file name and returns a python dictionary that represents all the interactions in the file. The file will be comma-delimited, and each line in it will have the following format:
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:
Submit a module named ppi.py that contains these functions.
Submit a module named ppi.py that contains this class and submit it via ramct.
average_interactions(interactions). Returns the average number of proteins a protein interacts with in the given interaction dataset.
average_interactions(interactions). Returns the average number of interactions over all proteins in the given set of interactions.
get_interactions(id, interactions). This function returns the IDs of all the proteins with which the protein with the given ID interacts with in the given interaction dataset.
get_interactions(id, interactions). This function returns the IDs of all the proteins with which the protein with the given ID interacts with in the given interaction dataset. Extra credit will be given to an implementation in which this function in constant time regardless of the number of proteins in the dataset. For our purposes assume that accessing an element in a dictionary takes constant time regardless of the number of elements in the dictionary (this actually holds under certain conditions).
Submit a module named ppi.py that contains these functions.
This indicates that protein_a interacts with protein_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 paper
This indicates that protein_a interacts with protein_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 paper
interact(id1, id2, interactions). This function receives the IDs of two proteins and returnsTrueif they appear in the given interaction dataset, and @@False@ otherwise.
interact(id1, id2, interactions). This function receives the IDs of two proteins and returnsTrueif they appear in the given interaction dataset, andFalseotherwise.
yeast interactions. This file contains 10,517 interactions in yeast extracted from the Bind database, and used in this paper
yeast interactions. This file contains 10,517 interactions in yeast extracted from the Bind database, and used in this paper
interact(id1, id2, interactions). This function receives the IDs of two proteins and returnsTrueif they appear in the given interaction dataset, and @@False@ otherwise.get_interactions(id, interactions). 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(interactions). Returns the average number of proteins a protein interacts with in the given interaction dataset.
This indicates that protein_a interacts with protein_b.
As an example you can use the following interaction dataset:
This indicates that protein_a interacts with protein_b. As an example you can use the following interaction dataset:
load_interactions(file_name). This function receives as a parameter a file name and returns a python dictionary that represents all the interactions in the file. The file will be comma-delimited, and each line in it will have the following format:
protein_a,protein_b
load_interactions(file_name). This function receives as a parameter a file name and returns a python dictionary that represents all the interactions in the file. The file will be comma-delimited, and each line in it will have the following format:protein_a,protein_b
. This file contains
yeast interactions. This file contains 10,517 interactions in yeast extracted from the Bind database, and used in this paper
Assignment 9
Due date: 4/5/10
Handling protein protein interaction data
In this assignment you will write several functions that load a dataset of protein-protein interactions, and enable a user to query the data. The functions you need to write are:
load_interactions(file_name). This function receives as a parameter a file name and returns a python dictionary that represents all the interactions in the file. The file will be comma-delimited, and each line in it will have the following format:
protein_a,protein_b
This indicates that protein_a interacts with protein_b.
As an example you can use the following interaction dataset:
.
This file contains
