Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
MCI_solutions Class Reference

Constructor

 __init__ (self)
 init

Emulating a Container

 __len__ (self)
 len
 __contains__ (self, tuple)
 A solution is 'known' if it has the same contacts.
 __getitem__ (self, index)
 getitem
 __copy__ (self)
 copy

Printing

 pretty_print_solutions (self, in_filename='Unnamed instance', out_filename=None, G=None, algorithm=None, verbose=0)
 Print the results either in the standard output (default) or in the specified file (out_filename).

Serializaing Solutions

 append_solution_tuple (self, tuple, magic=True)
 Append a tuple to the list of known solution unless it is already known.
 add_known_solutions (self, solutions)
 A setter function to add the known solutions in empty attribute.
 get_set_of_solutions (self)
 Return set of solutions in a lexico ordering.
 get_union_of_contacts (self)
 Return union of contacts in all solutions.
 fill_contacts_to_counts_map (self)
 fill_contacts_to_counts_map
 get_contacts_to_counts_map (self)
 get_contacts_to_counts_map
 get_count_for_the_contact_from_the_map (self, contact)
 get_count_for_the_contact_from_the_map
 get_length_of_contacts_to_counts_map (self)
 get_length_of_contacts_to_counts_map
 does_contacts_to_counts_map_has_the_contact (self, contact)
 does_contacts_to_counts_map_has_the_contact
 compute_and_store_solution_scores (self)
 solution scores are computed and stored score of a solution is sum of counts for each contact in the solution
 compute_and_store_false_positive_counts (self, afile)
 compute_and_store_false_positive_counts
 compare_against_solution_set (self, other)
 Given two lists of pairs (cost, list of contacts) or triples (cost, list of contacts, time), returns True if the two lists contains the same solutions.
 store_solutions_to_file_as_dict (self, out_filename=None)
 Print all solutions in the specified file (out_filename) in the form of a dictionary.
 load_dict_of_solutions_from_file (self, in_filename=None)
 Load the dictionary of solutions from the specified file (in_filename).
 get_cost_components_average (self)
 dagarwal: temporary function return a tuple of average of components of cost over a solution set
 fill_up_protein_to_neighbors_in_union_of_solutions_map (self)
 fill_up_protein_to_neighbors_in_union_of_solutions_map
 get_protein_to_neighbors_in_union_of_solutions_map (self)
 get_protein_to_neighbors_in_union_of_solutions_map
 get_cost_and_runtime_pair_for_a_solution (self, soln)
 get_cost_and_runtime_pair_for_a_solution
 get_contact_score (self, p1, p2)
 Accessing Scores and Interesting Contacts / Solutions#.
 get_solution_score (self, solution)
 Return the score of a solution, that is the sum of the scores of its contacts.
 get_consensus_solutions (self)
 Return the consensus solutions, i.e the top scoring solutions.
 get_consensus_contacts (self)
 Return all the contacts of the consensus solutions.
 get_top_scoring_contacts (self)
 Return all the top scoring contacts of the solutions.
 get_top_scoring_consensus_contacts (self)
 Return all the top scoring contacts of the consensus solutions.

Detailed Description

A class to store solutions, each as a triple (cost, set of contacts, running time per solution)

A class to store solutions, each as a triple (cost, set of contacts, running time per solution).
In addition this class stores a dictionary attribute which is then used to compute solution score in the class MCI_set_of_contacts.
The value of the dictionary attribute is the contact count which is number of times a contact appears in the whole solution set – {key=contact, value=counts}

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self)

init

Member Function Documentation

◆ __contains__()

__contains__ ( self,
tuple )

A solution is 'known' if it has the same contacts.

The solution cost and the computation time are omitted in the test.

◆ __copy__()

__copy__ ( self)

copy

◆ __getitem__()

__getitem__ ( self,
index )

getitem

◆ __len__()

__len__ ( self)

len

◆ add_known_solutions()

add_known_solutions ( self,
solutions )

A setter function to add the known solutions in empty attribute.

◆ append_solution_tuple()

append_solution_tuple ( self,
tuple,
magic = True )

Append a tuple to the list of known solution unless it is already known.

When 'magic' is True, we check if the input tuple is already known, in which case we don't add it, or if it is a subset of a known solution. In such case, we discard the known solution before adding the new one.

◆ compare_against_solution_set()

compare_against_solution_set ( self,
other )

Given two lists of pairs (cost, list of contacts) or triples (cost, list of contacts, time), returns True if the two lists contains the same solutions.

xfc: exploit the fact that a Set_of_contacts has a canonical representation

◆ compute_and_store_false_positive_counts()

compute_and_store_false_positive_counts ( self,
afile )

compute_and_store_false_positive_counts

◆ compute_and_store_solution_scores()

compute_and_store_solution_scores ( self)

solution scores are computed and stored score of a solution is sum of counts for each contact in the solution

◆ does_contacts_to_counts_map_has_the_contact()

does_contacts_to_counts_map_has_the_contact ( self,
contact )

does_contacts_to_counts_map_has_the_contact

◆ fill_contacts_to_counts_map()

fill_contacts_to_counts_map ( self)

fill_contacts_to_counts_map

◆ fill_up_protein_to_neighbors_in_union_of_solutions_map()

fill_up_protein_to_neighbors_in_union_of_solutions_map ( self)

fill_up_protein_to_neighbors_in_union_of_solutions_map

◆ get_consensus_contacts()

get_consensus_contacts ( self)

Return all the contacts of the consensus solutions.

◆ get_consensus_solutions()

get_consensus_solutions ( self)

Return the consensus solutions, i.e the top scoring solutions.

◆ get_contact_score()

get_contact_score ( self,
p1,
p2 )

Accessing Scores and Interesting Contacts / Solutions#.

Return the score of a contact, that is the number of solutions containing this contact.

◆ get_contacts_to_counts_map()

get_contacts_to_counts_map ( self)

get_contacts_to_counts_map

◆ get_cost_and_runtime_pair_for_a_solution()

get_cost_and_runtime_pair_for_a_solution ( self,
soln )

get_cost_and_runtime_pair_for_a_solution

◆ get_cost_components_average()

get_cost_components_average ( self)

dagarwal: temporary function return a tuple of average of components of cost over a solution set

◆ get_count_for_the_contact_from_the_map()

get_count_for_the_contact_from_the_map ( self,
contact )

get_count_for_the_contact_from_the_map

◆ get_length_of_contacts_to_counts_map()

get_length_of_contacts_to_counts_map ( self)

get_length_of_contacts_to_counts_map

◆ get_protein_to_neighbors_in_union_of_solutions_map()

get_protein_to_neighbors_in_union_of_solutions_map ( self)

get_protein_to_neighbors_in_union_of_solutions_map

◆ get_set_of_solutions()

get_set_of_solutions ( self)

Return set of solutions in a lexico ordering.

◆ get_solution_score()

get_solution_score ( self,
solution )

Return the score of a solution, that is the sum of the scores of its contacts.

◆ get_top_scoring_consensus_contacts()

get_top_scoring_consensus_contacts ( self)

Return all the top scoring contacts of the consensus solutions.

◆ get_top_scoring_contacts()

get_top_scoring_contacts ( self)

Return all the top scoring contacts of the solutions.

◆ get_union_of_contacts()

get_union_of_contacts ( self)

Return union of contacts in all solutions.

◆ load_dict_of_solutions_from_file()

load_dict_of_solutions_from_file ( self,
in_filename = None )

Load the dictionary of solutions from the specified file (in_filename).

◆ pretty_print_solutions()

pretty_print_solutions ( self,
in_filename = 'Unnamed instance',
out_filename = None,
G = None,
algorithm = None,
verbose = 0 )

Print the results either in the standard output (default) or in the specified file (out_filename).

◆ store_solutions_to_file_as_dict()

store_solutions_to_file_as_dict ( self,
out_filename = None )

Print all solutions in the specified file (out_filename) in the form of a dictionary.