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")
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')
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)
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))
__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)
def setUp(self): self.chicken = Genome(Species='chicken', Release=Release, account=account)
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)
def test_pool_connection(self): """excercising ability to specify pool connection""" dog = Genome(Species="dog", Release=Release, account=account, pool_recycle=1000)
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]