Exemplo n.º 1
0
    def test_minimal_obo_converts_alts(self):
        """converts alt ids into canonical ids - using MinimalObo class."""

        obo = MinimalObo(alts_file)
        # the next three ids are defined in the obo
        self.assertEqual(obo.canonical("AA:02"), "AA:2")
        self.assertEqual(obo.canonical("AA:03"), "AA:3")
        self.assertEqual(obo.canonical("AA:003"), "AA:3")
        # second time should use cache
        self.assertEqual(obo.canonical("AA:003"), "AA:3")
        # the next few are not in the obo
        self.assertEqual(obo.canonical("AA:000"), None)
        self.assertEqual(obo.canonical("AA:002"), None)
Exemplo n.º 2
0
    def test_obo_canonical(self):
        """official ids are canonical ids."""

        obo = Obo(alts_file)
        self.assertEqual(obo.canonical("AA:1"), "AA:1")
        self.assertEqual(obo.canonical("AA:2"), "AA:2")
        minobo = MinimalObo(alts_file)
        self.assertEqual(minobo.canonical("AA:1"), "AA:1")
        self.assertEqual(minobo.canonical("AA:2"), "AA:2")