Beispiel #1
0
 def add_native_record(self, assignment, RFs, total_score,
                       restraints_scores):
     """
         Add a record for the native structure to the database
         see add_record() for the meaning of the parameters
     """
     words = [io.ReferenceFrameToText(ref).get_text() for ref in RFs]
     RFs_txt = unit_delim.join(words)
     solution_id = 0
     record = [solution_id, assignment, RFs_txt, total_score] + \
         restraints_scores
     measures = [0, 0, 0]  # ["drms", "cdrms", "crmsd"]
     record = record + measures
     self.store_data(self.native_table_name, [record])
Beispiel #2
0
 def add_record(self, solution_id, assignment, RFs, total_score,
                restraints_scores, measures):
     """
         Add a recorde to the database
         @param solution_id The key for the solution
         @param assignment The assigment for the solution provided by
                           domino
         @param RFs Reference frames of the rigid bodies of the components
         of the assembly in the solution
         @param total_score Total value of the scoring function
         @param restraints_scores A list with all the values for the
                  restraints
         @param measures A list with the values of all the measures for
         benchmark
     """
     words = [io.ReferenceFrameToText(ref).get_text() for ref in RFs]
     RFs_txt = unit_delim.join(words)
     record = [solution_id, assignment, RFs_txt, total_score] + \
         restraints_scores
     if measures is not None:
         record = record + measures
     self.records.append(record)
Beispiel #3
0
 def get_assignment_and_RFs(self, assignment, subset):
     """
         Return a line with texts for an assignment and the
         the reference frames of the RigidBodies in the subset.
         @param subset Subset of components of the assembly
         @param assignment Assignment class with the states for the subset
         @note: see the get_assignment_assignment_text() note.
     """
     ordered_assignment = []
     RFs = []
     for rb in self.components_rbs:
         for i, particle in enumerate(subset):
             if rb.get_particle() == particle:
                 j = assignment[i]
                 ordered_assignment.append(j)
                 pstates = self.rb_states_table.get_particle_states(rb)
                 pstates.load_particle_state(j, rb.get_particle())
                 RFs.append(rb.get_reference_frame())
     RFs_text = unit_delim.join(
         [io.ReferenceFrameToText(ref).get_text() for ref in RFs])
     assignment_numbers = "|".join([str(i) for i in ordered_assignment])
     return [assignment_numbers, RFs_text]