예제 #1
0
class GenomeTestBase(TestCase):
    human = Genome(Species="human", Release=Release, account=account)
    mouse = Genome(Species="mouse", Release=Release, account=account)
    rat = Genome(Species="rat", Release=Release, account=account)
    macaq = Genome(Species="macaque", Release=Release, account=account)
    gorilla = Genome(Species="gorilla", Release=Release, account=account)
    brca2 = human.getGeneByStableId(StableId="ENSG00000139618")
예제 #2
0
 def test_gorilla(self):
     """should correctly return a gorilla gene"""
     self.gorilla = Genome(Species="gorilla",
                           Release=Release,
                           account=account)
     gene = self.gorilla.getGeneByStableId('ENSGGOG00000005730')
     self.assertEquals(str(gene.Seq[:10]), 'TGGGAGTCCA')
예제 #3
0
 def _attach_genomes(self):
     for species in self.Species:
         attr_name = _Species.getComparaName(species)
         genome = Genome(Species=species,
                         Release=self.Release,
                         account=self._account)
         self._genomes[species] = genome
         setattr(self, attr_name, genome)
예제 #4
0
 def test_no_assembly(self):
     """return N's for coordinates with no assembly"""
     krat = Genome('Kangaroo rat', Release=58)
     Start = 24385
     End = Start + 100
     region = krat.getRegion(CoordName='scaffold_13754',
                             Start=Start,
                             End=End)
     self.assertEquals(str(region.Seq), 'N' * (End - Start))
예제 #5
0
__email__ = "*****@*****.**"
__status__ = "alpha"

Release = 76

if 'ENSEMBL_ACCOUNT' in os.environ:
    args = os.environ['ENSEMBL_ACCOUNT'].split()
    host, username, password = args[0:3]
    kwargs = {}
    if len(args) > 3:
        kwargs['port'] = int(args[3])
    account = HostAccount(host, username, password, **kwargs)
else:
    account = get_ensembl_account(release=Release)

human = Genome(Species='human', Release=Release, account=account)
platypus = Genome(Species='platypus', Release=Release, account=account)


class TestLocation(TestCase):
    def test_init(self):
        human_loc = Coordinate(CoordName='x',
                               Start=1000,
                               End=10000,
                               Strand=-1,
                               genome=human)
        # TODO: complete test for platpus
        self.assertEqual(human_loc.CoordType, 'chromosome')
        self.assertEqual(human_loc.CoordName, 'x')
        self.assertEqual(human_loc.Start, 1000)
        self.assertEqual(human_loc.End, 10000)
예제 #6
0
 def setUp(self):
     self.chicken = Genome(Species='chicken', Release=Release,
                         account=account)
예제 #7
0
 def test_genome_comparison(self):
     """different genome instances with same CoreDb connection are equal"""
     h2 = Genome(Species='human', Release=Release, account=account)
     self.assertEquals(self.human, h2)
예제 #8
0
 def test_pool_connection(self):
     """excercising ability to specify pool connection"""
     dog = Genome(Species="dog",
                  Release=Release,
                  account=account,
                  pool_recycle=1000)
예제 #9
0
class GenomeTestBase(TestCase):
    human = Genome(Species="human", Release=Release, account=account)
    mouse = Genome(Species="mouse", Release=Release, account=account)
    rat = Genome(Species="rat", Release=Release, account=account)
    macaq = Genome(Species="macaque", Release=Release, account=account)
    brca2 = list(human.getGenesMatching(StableId="ENSG00000139618"))[0]