Esempio n. 1
0
    def test_get_omim(self):
        d1 = Omim(diseaseid=1, name='Gaucher')
        d2 = Omim(diseaseid=2, name='Fabry')

        self.assertEqual(Omim.get(1), d1)
        self.assertEqual(Omim.get(2), d2)
        self.assertEqual(Omim.get('1'), d1)

        self.assertRaises(ValueError, lambda: Omim.get('Fabry'))
        self.assertRaises(KeyError, lambda: Omim.get(12))
Esempio n. 2
0
    def test_set_with_one_annotation(self):
        ci = HPOSet([self.ontology[11], self.ontology[13], self.ontology[31]])

        assert len(ci.all_genes()) == 1
        assert len(ci.omim_diseases()) == 1
        assert len(ci.orpha_diseases()) == 1
        assert len(ci.decipher_diseases()) == 1

        assert ci.all_genes() == set([Gene.get(0)])
        assert ci.omim_diseases() == set([Omim.get(0)])
        assert ci.orpha_diseases() == set([Orpha.get(0)])
        assert ci.decipher_diseases() == set([Decipher.get(0)])