Main.Assignment9 History
Hide minor edits - Show changes to markup
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
