def test_get_orpha(self): d1 = Orpha(diseaseid=1, name='Gaucher') d2 = Orpha(diseaseid=2, name='Fabry') self.assertEqual(Orpha.get(1), d1) self.assertEqual(Orpha.get(2), d2) self.assertEqual(Orpha.get('1'), d1) self.assertRaises(ValueError, lambda: Orpha.get('Fabry')) self.assertRaises(KeyError, lambda: Orpha.get(12))
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)])