Example #1
0
    def test_get_distinct(self):
        """should return list of strings"""
        db = Database(account=account,
                      release=Release,
                      species='human',
                      db_type='variation')
        tn, tc = 'variation_feature', 'consequence_type'
        expected = set((('3PRIME_UTR', 'ESSENTIAL_SPLICE_SITE'),
                        ('3PRIME_UTR', 'SPLICE_SITE'),
                        ('5PRIME_UTR', 'ESSENTIAL_SPLICE_SITE')))
        self.assertNotEquals(set(db.getDistinct(tn, tc)) & expected, set())

        db = Database(account=account,
                      release=Release,
                      species='human',
                      db_type='core')
        tn, tc = 'gene', 'biotype'
        expected = set([
            'protein_coding', 'pseudogene', 'processed_transcript', 'Mt_tRNA',
            'Mt_rRNA', 'IG_V_gene', 'IG_J_gene', 'IG_C_gene', 'IG_D_gene',
            'miRNA', 'misc_RNA', 'snoRNA', 'snRNA', 'rRNA'
        ])
        got = set(db.getDistinct(tn, tc))
        self.assertEquals(len(got & expected), len(expected))

        db = Database(account=account, release=Release, db_type='compara')
        got = set(db.getDistinct('homology', 'description'))
        expected = set([
            'apparent_ortholog_one2one', 'between_species_paralog',
            'ortholog_many2many', 'ortholog_one2many', 'ortholog_one2one',
            'within_species_paralog'
        ])
        self.assertEquals(len(got & expected), len(expected))
Example #2
0
 def test_get_distinct(self):
     """should return list of strings"""
     db = Database(account=account, release=Release,
                 species='human', db_type='variation')
     tn, tc = 'variation_feature', 'consequence_types'
     expected = set(('3_prime_UTR_variant', 'splice_acceptor_variant',
                     '5_prime_UTR_variant'))
     got = db.getDistinct(tn, tc)
     self.assertNotEquals(set(got) & expected, set())
     
     db = Database(account=account, release=Release,
                 species='human', db_type='core')
     tn, tc = 'gene', 'biotype'
     expected = set(['protein_coding', 'pseudogene', 'processed_transcript', 
       'Mt_tRNA', 'Mt_rRNA', 'IG_V_gene', 'IG_J_gene',
       'IG_C_gene', 'IG_D_gene', 'miRNA', 'misc_RNA', 'snoRNA', 'snRNA', 'rRNA'])
     got = set(db.getDistinct(tn, tc))
     self.assertNotEquals(set(got) & expected, set())
     
     db = Database(account=account, release=Release, db_type='compara')
     got = set(db.getDistinct('homology', 'description'))
     expected = set([u'gene_split', u'alt_allele', u'other_paralog',
         u'ortholog_one2many', u'ortholog_one2one',
         u'within_species_paralog', u'ortholog_many2many'])
     self.assertEquals(len(got&expected), len(expected))
Example #3
0
    def test_get_distinct(self):
        """should return list of strings"""
        db = Database(account=account,
                      release=Release,
                      species='human',
                      db_type='variation')
        tn, tc = 'variation_feature', 'consequence_types'
        expected = set(('3_prime_UTR_variant', 'splice_acceptor_variant',
                        '5_prime_UTR_variant'))
        got = db.getDistinct(tn, tc)
        self.assertNotEqual(set(got) & expected, set())

        db = Database(account=account,
                      release=Release,
                      species='human',
                      db_type='core')
        tn, tc = 'gene', 'biotype'
        expected = set([
            'protein_coding', 'pseudogene', 'processed_transcript', 'Mt_tRNA',
            'Mt_rRNA', 'IG_V_gene', 'IG_J_gene', 'IG_C_gene', 'IG_D_gene',
            'miRNA', 'misc_RNA', 'snoRNA', 'snRNA', 'rRNA'
        ])
        got = set(db.getDistinct(tn, tc))
        self.assertNotEqual(set(got) & expected, set())

        db = Database(account=account, release=Release, db_type='compara')
        got = set(db.getDistinct('homology', 'description'))
        expected = set([
            'gene_split', 'alt_allele', 'other_paralog', 'ortholog_one2many',
            'ortholog_one2one', 'within_species_paralog', 'ortholog_many2many'
        ])
        self.assertEqual(len(got & expected), len(expected))
Example #4
0
    def test_get_distinct(self):
        """should return list of strings"""
        db = Database(account=account, release=Release, species="human", db_type="variation")
        tn, tc = "variation_feature", "consequence_type"
        expected = set(
            (
                ("3PRIME_UTR", "ESSENTIAL_SPLICE_SITE"),
                ("3PRIME_UTR", "SPLICE_SITE"),
                ("5PRIME_UTR", "ESSENTIAL_SPLICE_SITE"),
            )
        )
        self.assertNotEquals(set(db.getDistinct(tn, tc)) & expected, set())

        db = Database(account=account, release=Release, species="human", db_type="core")
        tn, tc = "gene", "biotype"
        expected = set(
            [
                "protein_coding",
                "pseudogene",
                "processed_transcript",
                "Mt_tRNA",
                "Mt_rRNA",
                "IG_V_gene",
                "IG_J_gene",
                "IG_C_gene",
                "IG_D_gene",
                "miRNA",
                "misc_RNA",
                "snoRNA",
                "snRNA",
                "rRNA",
            ]
        )
        got = set(db.getDistinct(tn, tc))
        self.assertEquals(len(got & expected), len(expected))

        db = Database(account=account, release=Release, db_type="compara")
        got = set(db.getDistinct("homology", "description"))
        expected = set(
            [
                "apparent_ortholog_one2one",
                "between_species_paralog",
                "ortholog_many2many",
                "ortholog_one2many",
                "ortholog_one2one",
                "within_species_paralog",
            ]
        )
        self.assertEquals(len(got & expected), len(expected))