Example #1
0
class EvidenceTestCase(unittest.TestCase):
    def setUp(self):
        """
        Because _process_evidence_view uses
        self.rawdir to find the evidence file,
        the defaults are overriden here to
        point to our test file
        Note the file name must match what is in
        that method - evidence_view
        """
        self.test_util = TestUtils()
        self.mgi = MGI('rdf_graph', True)
        self.mgi.rawdir = os.path.join(os.path.dirname(__file__),
                                       'resources/mgi')
        self.mgi.idhash['annot']['6901981'] = ':association'

    def tearDown(self):
        self.mgi = None
        return

    def test_sex_specificity_model(self):
        self.mgi.graph = RDFGraph(True)  # Reset graph
        self.mgi._process_evidence_view(limit=None)
        logger.debug("Reference graph: %s",
                     self.mgi.graph.serialize(format="turtle").decode("utf-8"))
        expected_triples = """
        :association RO:0002558 ECO:0000006 ;
            dc:source J:74619 ;
            :has_sex_specificity PATO:0000384 .

        J:74619 a IAO:0000310 .
        """
        self.assertTrue(
            self.test_util.test_graph_equality(expected_triples,
                                               self.mgi.graph))
Example #2
0
class MGITestCase(SourceTestCase):
    def setUp(self):
        self.source = MGI('rdf_graph', True)
        self.source.settestonly(True)
        self._setDirToSource()
        return

    def tearDown(self):
        self.source = None
        return
Example #3
0
class MGITestCase(SourceTestCase):

    def setUp(self):
        self.source = MGI('rdf_graph', True)
        self.source.settestonly(True)
        self._setDirToSource()
        return

    def tearDown(self):
        self.source = None
        return
Example #4
0
 def setUp(self):
     """
     Because _process_evidence_view uses
     self.rawdir to find the evidence file,
     the defaults are overriden here to
     point to our test file
     Note the file name must match what is in
     that method - evidence_view
     """
     self.test_util = TestUtils()
     self.mgi = MGI('rdf_graph', True)
     self.mgi.rawdir = os.path.join(os.path.dirname(__file__),
                                    'resources/mgi')
     self.mgi.idhash['annot']['6901981'] = ':association'
Example #5
0
 def setUp(self):
     """
     Because _process_evidence_view uses
     self.rawdir to find the evidence file,
     the defaults are overriden here to
     point to our test file
     Note the file name must match what is in
     that method - evidence_view
     """
     self.test_util = TestUtils()
     self.mgi = MGI('rdf_graph', True)
     self.mgi.rawdir = os.path.join(os.path.dirname(__file__), 'resources/mgi')
     self.mgi.idhash['annot']['6901981'] = ':association'
Example #6
0
class EvidenceTestCase(unittest.TestCase):

    def setUp(self):
        """
        Because _process_evidence_view uses
        self.rawdir to find the evidence file,
        the defaults are overriden here to
        point to our test file
        Note the file name must match what is in
        that method - evidence_view
        """
        self.test_util = TestUtils()
        self.mgi = MGI('rdf_graph', True)
        self.mgi.rawdir = os.path.join(
            os.path.dirname(__file__), 'resources/mgi')
        self.mgi.idhash['annot']['6901981'] = ':association'

    def tearDown(self):
        self.mgi = None
        return

    def test_sex_specificity_model(self):
        self.mgi.graph = RDFGraph(True)  # Reset graph

        self.mgi._process_evidence_view(limit=None)
        logger.debug(
            "Reference graph: %s",
            self.mgi.graph.serialize(format="turtle").decode("utf-8"))
        expected_triples = """
        :association RO:0002558 ECO:0000006 ;
            dc:source J:74619 ;
            :has_sex_specificity PATO:0000384 .

        J:74619 a IAO:0000310 .
        """
        self.assertTrue(self.test_util.test_graph_equality(
            expected_triples, self.mgi.graph))
Example #7
0
 def setUp(self):
     self.source = MGI()
     self.source.settestonly(True)
     self.source.setnobnodes(True)
     self._setDirToSource()
     return
Example #8
0
 def setUp(self):
     self.source = MGI('rdf_graph', True)
     self.source.settestonly(True)
     self._setDirToSource()
     return
Example #9
0
 def setUp(self):
     self.source = MGI('rdf_graph', True)
     self.source.settestonly(True)
     self._setDirToSource()
     return