Пример #1
0
 def test_at_spec(self, mocked_get, mocked_match):
     mocked_match.return_value = True
     for sig in ["HF", "YS", "HS", "YF", "NN"]:
         mocked_get.return_value = [
             DummyAlignment(sig, {
                 195: sig[0],
                 197: sig[1]
             })
         ]
         pairings = analysis.pksi_at_spec(self.record)
         if sig == "HF":
             assert pairings == [(sig, "Malonyl-CoA specific")]
         elif sig == "YS":
             assert pairings == [(sig, "Methylmalonyl-CoA specific")]
         else:
             assert pairings == [
                 (sig, "Neither malonyl-CoA or methylmalonyl-CoA specific")
             ]
     # and an inconclusive
     mocked_match.return_value = False
     # values here don't matter
     mocked_get.return_value = [DummyAlignment("incon", {})]
     pairings = analysis.pksi_at_spec(self.record)
     assert pairings == [("incon",
                          "(Methyl)Malonyl-CoA specificity inconclusive")]
Пример #2
0
 def test_at_spec(self):
     with umock.patch.object(active_site_finder.common.ActiveSiteAnalysis,
                             "scaffold_matches") as mocked_match:
         mocked_match.return_value = True
         for sig in ["HF", "YS", "HS", "YF", "NN"]:
             mock(
                 "active_site_finder.common.ActiveSiteAnalysis.get_alignments",
                 returns=[DummyAlignment(sig, {
                     195: sig[0],
                     197: sig[1]
                 })])
             pairings = analysis.pksi_at_spec(self.record)
             if sig == "HF":
                 assert pairings == [(sig, "Malonyl-CoA specific")]
             elif sig == "YS":
                 assert pairings == [(sig, "Methylmalonyl-CoA specific")]
             else:
                 assert pairings == [
                     (sig,
                      "Neither malonyl-CoA or methylmalonyl-CoA specific")
                 ]
         # 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_at_spec(self.record)
         assert pairings == [
             ("incon", "(Methyl)Malonyl-CoA specificity inconclusive")
         ]
Пример #3
0
 def test_AT_spec(self):
     mock("subprocessing.run_hmmpfam2", returns=parse_hmmpfam_results("AT.output"))
     results = analysis.pksi_at_spec(self.record)
     expected = {'PKS_AT0': '(Methyl)Malonyl-CoA specificity inconclusive',
                 'PKS_AT1': 'Neither malonyl-CoA or methylmalonyl-CoA specific',
                 'PKS_AT2': '(Methyl)Malonyl-CoA specificity inconclusive',
                 'PKS_AT3': '(Methyl)Malonyl-CoA specificity inconclusive'}
     assert {dom.domain_id: message for dom, message in results} == expected