def test_mirna_reference(self): self.assertEqual('m(HGNC:MIR1)', str(mirna(namespace='HGNC', name='MIR1')))
g1 = gene(HGNC, '1') r1 = rna(HGNC, '1') p1 = protein(HGNC, '1') p1_phosphorylated = protein(HGNC, '1', variants=[pmod('Ph')]) g2 = gene(HGNC, '2') r2 = rna(HGNC, '2') p2 = protein(HGNC, '2') g3 = gene(HGNC, '3') r3 = rna(HGNC, '3') p3 = protein(HGNC, '3') g4 = gene(HGNC, '4') m4 = mirna(HGNC, '4') p5 = pathology(GO, '5') class TestCollapse(unittest.TestCase): """Tests for collapse functions.""" def test_collapse_by_dict(self): """Test collapsing nodes by a dictionary.""" graph = BELGraph() graph.add_node_from_data(p1) graph.add_node_from_data(p2) graph.add_node_from_data(p3) graph.add_increases(p1, p3, citation=n(), evidence=n()) graph.add_qualified_edge(p2,
"""Tests for Bio2BEL miRTarBase.""" from bio2bel_mirtarbase.manager import _build_entrez_map from bio2bel_mirtarbase.models import Evidence, HGNC, MIRBASE, Mirna, NCBIGENE, Species, Target from pybel import BELGraph from pybel.constants import FUNCTION, IDENTIFIER, NAME, NAMESPACE from pybel.dsl import BaseAbundance, mirna, rna from tests.constants import TemporaryFilledCacheMixin hif1a_symbol = 'HIF1A' hif1a_hgnc_name = rna(name=hif1a_symbol, namespace=HGNC) hif1a_hgnc_identifier = rna(identifier='4910', namespace=HGNC) hif1a_entrez_name = rna(name='3091', namespace=NCBIGENE) hif1a_entrez_identifier = rna(identifier='3091', namespace=NCBIGENE) mi2_data = mirna(name='hsa-miR-20a-5p', namespace=MIRBASE) mi5_data = mirna(name='mmu-miR-124-3p', namespace=MIRBASE) class TestBuildDatabase(TemporaryFilledCacheMixin): """Test the database.""" def test_count_human_genes(self): """Test the number of genes in Bio2BEL HGNC.""" self.assertEqual(2, self.hgnc_manager.count_human_genes()) def test_count_mirnas(self): """Test the number of miRNAs.""" self.assertEqual(5, self.manager.count_mirnas()) def test_count_targets(self): """Test the number of targets."""