예제 #1
0
class TestComparativeMethods(unittest.TestCase):
    def setUp(self):
        self.api = WormbaseClient()

    def doTest(self, response):
        self.assertTrue(test_util.is_dict(response))

    def test_gene_tree_dump(self):
        self.doTest(self.api.get_gene_tree_dump('WBGT00000000021204'))

    def test_gene_tree_by_member(self):
        self.doTest(self.api.get_gene_tree_by_member('WBGene00221255'))

    def test_gene_tree_with_gene(self):
        self.doTest(
            self.api.get_gene_tree_with_gene('Bm994',
                                             'brugia_malayi_prjna10729'))

    def test_orthologues_by_gene(self):
        self.doTest(self.api.get_orthologues_by_gene('WBGene00221255'))

    def test_orthologues_by_symbol(self):
        self.doTest(
            self.api.get_orthologues_by_symbol('brugia_malayi_prjna10729',
                                               'Bm994'))
예제 #2
0
class TestLookupMethods(unittest.TestCase):
    def setUp(self):
        self.api = WormbaseClient()

    def doTest(self, response):
        self.assertTrue(test_util.is_dict(response))

    def test_batch_symbol(self):
        symbols = ["Bm994", "__VAR(gene_symbol2)__"]
        self.doTest(
            self.api.batch_get_symbol_from_external_db(
                'brugia_malayi_prjna10729', symbols))

    def test_batch_id(self):
        ids = ["WBGene00221255", "__VAR(gene_stable_id_2)__"]
        self.doTest(self.api.batch_lookup_by_id(ids))

    def test_lookup_id(self):
        self.doTest(self.api.lookup_by_id('WBGene00221255'))

    def test_lookup_by_name(self):
        self.assertTrue(
            type(self.api.lookup_by_name('brugia_malayi_prjna10729')) is list)

    def test_lookup_symbol_external_db(self):
        self.doTest(
            self.api.get_symbol_from_external_db('brugia_malayi_prjna10729',
                                                 'Bm994'))
예제 #3
0
class TestMappingMethods(unittest.TestCase):
    def setUp(self):
        self.api = WormbaseClient()

    def doTest(self, response):
        self.assertTrue(test_util.is_dict(response))

    def test_cdna2genomic(self):
        self.doTest(self.api.cdna2genomic('Bm4789.1', 'transcript',
                                          '100..300'))

    def test_cds2genomic(self):
        self.doTest(self.api.cds2genomic('Bm4789.1', 'transcript', '1..300'))

    def test_protein2genomic(self):
        self.doTest(self.api.protein2genomic('Bm4789.1', '1..100'))
예제 #4
0
class TestCrossReferenceMethods(unittest.TestCase):
    def setUp(self):
        self.api = WormbaseClient()

    def doTest(self, response):
        self.assertTrue(type(response) is list)

    def test_xrefs_for_symbol(self):
        self.doTest(self.api.get_xrefs_for_symbol(
            'brugia_malayi_prjna10729', 'Bm994'))

    def test_xrefs_for_id(self):
        self.doTest(self.api.get_xrefs_for_id('WBGene00221255'))

    def test_xrefs_for_gene_and_species(self):
        self.doTest(self.api.get_xrefs_for_gene_and_species(
            'Bm994', 'brugia_malayi_prjna10729'))
예제 #5
0
class TestOntologyMethods(unittest.TestCase):
    def setUp(self):
        self.api = WormbaseClient()

    def doTest(self, response):
        self.assertTrue(type(response) is dict)

    def test_ancestry(self):
        self.assertTrue(type(self.api.get_ancestry('GO:0005667')) is list)

    def test_ancestry_chart(self):
        self.doTest(self.api.get_ancestry_chart('GO:0005667'))

    def test_get_descendants(self):
        self.assertTrue(type(self.api.get_descendants('GO:0005667')) is list)

    def test_ontology_by_id(self):
        self.doTest(self.api.get_ontology_by_id('GO:0005667'))

    def test_ontology_by_name(self):
        self.assertTrue(
            type(self.api.get_ontology_by_name('transcription')) is list)
예제 #6
0
class TestInformationMethods(unittest.TestCase):
    def setUp(self):
        self.api = WormbaseClient()

    def doTest(self, response):
        self.assertTrue(test_util.is_dict(response))

    def test_release_info(self):
        self.doTest(self.api.get_release_info())

    def test_available_species(self):
        self.doTest(self.api.get_available_species())

    def test_assemblies(self):
        self.doTest(
            self.api.get_assemblies_for_species('brugia_malayi_prjna10729'))

    def test_info_for_region(self):
        self.doTest(
            self.api.get_info_for_region('Bm_v4_Chr2_contig_001',
                                         'brugia_malayi_prjna10729'))

    def test_info_for_genome(self):
        self.doTest(self.api.get_info_for_genome('brugia_malayi_prjna10729'))

    def test_info_for_all_genomes(self):
        self.assertTrue(type(self.api.get_info_for_all_genomes()) is list)

    def test_info_for_genome_with_assembly(self):
        self.doTest(
            self.api.get_info_for_genome_with_assembly('GCA_000950995.1'))

    def test_info_for_taxonomy_node(self):
        self.assertTrue(
            type(self.api.get_info_for_taxonomy_node('Brugia')) is list)

    def test_quality_scores(self):
        self.doTest(
            self.api.get_quality_scores_for_genome('brugia_malayi_prjna10729'))
예제 #7
0
class TestSequenceMethods(unittest.TestCase):
    def setUp(self):
        self.api = WormbaseClient()

    def doTest(self, response):
        self.assertTrue(test_util.is_dict(response))

    def test_sequence(self):
        self.doTest(self.api.get_sequence("WBGene00221255"))

    def test_batch_sequence_with_list(self):
        self.assertTrue(
            type(
                self.api.batch_get_sequence(
                    ["WBGene00221255", "__VAR(gene_stable_id_2)__"])) is list)

    def test_batch_sequence_with_string(self):
        self.assertTrue(
            type(
                self.api.batch_get_sequence(
                    "WBGene00221255,__VAR(gene_stable_id_2)__")) is list)

    def test_sequence_for_region(self):
        self.doTest(
            self.api.get_sequence_for_region(
                'Bm_v4_Chr2_contig_001:13847151-13862157:1',
                'brugia_malayi_prjna10729'))

    def test_batch_sequence_for_region_with_list(self):
        region_list = [
            "Bm_v4_Chr2_contig_001:13847151-13862157:1",
            "Bmal_v3_scaffold139:57600..85000"
        ]
        self.assertTrue(
            type(
                self.api.batch_get_sequence_for_region(
                    'brugia_malayi_prjna10729', region_list)) is list)

    def test_batch_sequence_for_region_with_string(self):
        region_string = "Bm_v4_Chr2_contig_001:13847151-13862157:1,Bmal_v3_scaffold139:57600..85000"
        self.assertTrue(
            type(
                self.api.batch_get_sequence_for_region(
                    'brugia_malayi_prjna10729', region_string)) is list)
예제 #8
0
 def setUp(self):
     self.api = WormbaseClient()