Esempio n. 1
0
 def test_find_fragment_candidates(self):
     """Should return a FragmentCandidates instance"""
     lf = FragmentFinder(self.struc['2'], self.struc['6'], Sequence('AGCU'),
                         self.struc, 10)
     cand = lf.find_fragment_candidates()
     self.assertTrue(isinstance(cand, FragmentCandidates))
     self.assertTrue(1 <= len(cand) <= 10)
Esempio n. 2
0
 def test_insert_in_itself(self):
     """Best fragment for LIR structures should come from itself."""
     for length, struc, chain, stem5, stem3, seq in FRAGMENTS_TO_INSERT:
         m = load_model(PATH_TO_LIR_STRUCTURES + struc, chain)
         lf = FragmentFinder(m[stem5], m[stem3], Sequence(seq), m, 2)
         candidates = lf.find_fragment_candidates()
         if len(candidates) > 0:
             best = candidates[0]
             self.assertEqual(best.structure, struc)
             self.assertEqual(best.chain, chain)
             self.assertEqual(best.preceding_residue, stem5)
             self.assertEqual(best.following_residue, stem3)
             self.assertAlmostEqual(best.rmsd, 0.000, 3)
Esempio n. 3
0
    def find_fragment_candidates(
            self,
            res5,
            res3,
            sequence,
            candidates_number=NUMBER_OF_FRAGMENT_CANDIDATES,
            lir_path=PATH_TO_LIR_STRUCTURES,
            secstruc=None):
        # en: candidate_number
        """
        Looks for fragment candidates for missing fragment in a structure.
        Returns list of fragment candidates.

        Arguments:
        - anchor residue on 5' end as a ModernaResidue instance (residue preceding missing fragment)
        - anchor residue on 3' end as a ModernaResidue instance (residue fallowing missing fragment)
        - missing sequence
        """
        fragment_finder = FragmentFinder(res5, res3, sequence, self,
                                         candidates_number, lir_path, secstruc)
        return fragment_finder.find_fragment_candidates(
        )  # FragmentCandidates instance