예제 #1
0
    def test_synth_subtree(self):
        def res_checker(test_case, results):
            tree = results.tree
            test_case.assertEqual(tree.seed_node.taxon.ott_id, 803675)

        args = ['--ott-id=803675']
        ex_runner(self, 'synth_subtree.py', args, res_checker)
    def test_study_properties(self):
        def res_checker(test_case, results):
            rd = results.response_dict
            test_case.assertTrue('tree_properties' in rd)
            test_case.assertTrue('study_properties' in rd)

        ex_runner(self, 'study_properties.py', [], res_checker)
예제 #3
0
    def test_find_studies(self):
        res = {"matched_studies": [{"ot:studyId": "pg_719"}]}

        def res_checker(test_case, results):
            test_case.assertEqual(res, results.response_dict)

        args = ['--property=ot:studyId', 'pg_719']
        ex_runner(self, 'find_studies.py', args, res_checker)
    def test_synth_subtree(self):

        def res_checker(test_case, results):
            taxon = results.taxon
            test_case.assertEqual(taxon.ott_id, 437610)
            test_case.assertTrue(len(taxon.lineage) > 0)
            
        args = ['--ott-id=437610']
        ex_runner(self, 'taxon_info.py', args, res_checker)
    def test_synth_node_info(self):

        def res_checker(test_case, results):
            nd_ref = results.node_ref
            nd_id = nd_ref.node_id
            # for n, ndf in enumerate(nd_ref.lineage):
            #    print('lineage_node_ref {} id={}'.format(n, ndf.node_id))
            test_case.assertTrue(nd_id == 'ott189136' or nd_id.startswith('mrca'))

        args = ['--ott-ids=189136', '--include-lineage']
        ex_runner(self, 'synth_node_info.py', args, res_checker)
예제 #6
0
    def test_synth_induced_subtree(self):
        def res_checker(test_case, results):
            tree = results.tree
            tn = tree.taxon_namespace
            for node in tree.leaf_node_iter():
                taxon = node.taxon
                if taxon.label != 'mrcaott246ott1566':
                    test_case.assertEqual(199350, taxon.ott_id)

        args = ['--ott-ids=199350',
                '--node-ids=mrcaott246ott1566']  # ott733093']
        ex_runner(self, 'synth_induced_subtree.py', args, res_checker)
    def test_tnrs_infer_contexts(self):
        res = {
            "ambiguous_names": [],
            "context_name": "Mammals",
            "context_ott_id": 244265,
        }

        def res_checker(test_case, results):
            test_case.assertEqual(res, results.response_dict)

        args = ['Pan', 'H**o']
        ex_runner(self, 'tnrs_infer_contexts.py', args, res_checker)
    def test_find_trees(self):
        obj = {
            "matched_trees": [
                {"ot:studyId": "pg_719", "ot:treeId": "tree1294"},
                {"ot:studyId": "pg_719", "ot:treeId": "tree1295"},
                {"ot:studyId": "pg_719", "ot:treeId": "tree1296"}
            ],
            "ot:studyId": "pg_719"
            }
        res = {"matched_studies": [obj]}

        def res_checker(test_case, results):
            test_case.assertEqual(res, results.response_dict)

        args = ['--property=ot:studyId', 'pg_719']
        ex_runner(self, 'find_trees.py', args, res_checker)
    def test_get_tree(self):
        obj = {
            "matched_trees": [{
                "ot:studyId": "pg_719",
                "ot:treeId": "tree1294"
            }, {
                "ot:studyId": "pg_719",
                "ot:treeId": "tree1295"
            }, {
                "ot:studyId": "pg_719",
                "ot:treeId": "tree1296"
            }],
            "ot:studyId":
            "pg_719"
        }
        res = {"matched_studies": [obj]}

        def res_checker(test_case, results):
            test_case.assertTrue(str(results.tree).startswith('('))

        args = ['ot_1877', 'tree3', '--format=object']
        ex_runner(self, 'get_tree.py', args, res_checker)
예제 #10
0
 def test_tnrs_match_example(self):
     args = ['Characidiopsis acuta']
     ex_runner(self, 'tnrs_match_names.py', args)
 def test_about_example(self):
     ex_runner(self, 'about.py', None)