예제 #1
0
 def test_er_stereo(self):
     with umock.patch.object(active_site_finder.common.ActiveSiteAnalysis,
                             "scaffold_matches") as mocked_match:
         mocked_match.return_value = True
         for char in string.ascii_uppercase:
             mock(
                 "active_site_finder.common.ActiveSiteAnalysis.get_alignments",
                 returns=[DummyAlignment(char, {39: char})])
             pairings = analysis.pksi_er_stereo(self.record)
             if char == "Y":
                 assert pairings == [(
                     char,
                     "ER domain putatively catalyzing 2S-configuration product formation"
                 )]
             else:
                 assert pairings == [(
                     char,
                     "ER domain putatively catalyzing 2R-configuration product formation"
                 )]
         # and an inconclusive
         mocked_match.return_value = False
         # values here don't matter
         mock("active_site_finder.common.ActiveSiteAnalysis.get_alignments",
              returns=[DummyAlignment("incon", {})])
         pairings = analysis.pksi_er_stereo(self.record)
         assert pairings == [("incon", "ER configuration inconclusive")]
예제 #2
0
 def test_er_stereo(self, mocked_get, mocked_match):
     mocked_match.return_value = True
     for char in string.ascii_uppercase:
         mocked_get.return_value = [DummyAlignment(char, {39: char})]
         pairings = analysis.pksi_er_stereo(self.record)
         if char == "Y":
             assert pairings == [(char, "ER domain putatively catalyzing 2S-configuration product formation")]
         else:
             assert pairings == [(char, "ER domain putatively catalyzing 2R-configuration product formation")]
     # and an inconclusive
     mocked_match.return_value = False
     # values here don't matter
     mocked_get.return_value = [DummyAlignment("incon", {})]
     pairings = analysis.pksi_er_stereo(self.record)
     assert pairings == [("incon", "ER configuration inconclusive")]
예제 #3
0
 def test_ER(self):
     mock("subprocessing.run_hmmpfam2", returns=parse_hmmpfam_results("ER.output"))
     results = analysis.pksi_er_stereo(self.record)
     expected = {'Thioesterase0': 'active site serine present: True'}
     expected = {'PKS_ER0': 'ER configuration inconclusive',
                 'PKS_ER1': 'ER domain putatively catalyzing 2R-configuration product formation',
                 'PKS_ER2': 'ER configuration inconclusive'}
     assert {dom.domain_id: message for dom, message in results} == expected