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)])
def test_get_gene(self): g1 = Gene(hgncid=1, symbol='EZH1') g2 = Gene(hgncid=2, symbol='EZH2') self.assertEqual(Gene.get(1), g1) self.assertEqual(Gene.get(2), g2) self.assertEqual(Gene.get('1'), g1) self.assertEqual(Gene.get('EZH1'), g1) self.assertEqual(Gene.get('EZH2'), g2) self.assertRaises( KeyError, lambda: Gene.get('GBA') ) self.assertRaises( KeyError, lambda: Gene.get(12) )