本文整理汇总了Python中cogent.db.ensembl.species.Species.getEnsemblDbPrefix方法的典型用法代码示例。如果您正苦于以下问题:Python Species.getEnsemblDbPrefix方法的具体用法?Python Species.getEnsemblDbPrefix怎么用?Python Species.getEnsemblDbPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cogent.db.ensembl.species.Species
的用法示例。
在下文中一共展示了Species.getEnsemblDbPrefix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_ensembl_format
# 需要导入模块: from cogent.db.ensembl.species import Species [as 别名]
# 或者: from cogent.db.ensembl.species.Species import getEnsemblDbPrefix [as 别名]
def test_get_ensembl_format(self):
"""should take common or latin names and return the corresponding
ensembl db prefix"""
self.assertEqual(Species.getEnsemblDbPrefix("human"), "homo_sapiens")
self.assertEqual(Species.getEnsemblDbPrefix("mouse"), "mus_musculus")
self.assertEqual(Species.getEnsemblDbPrefix("Mus musculus"),
"mus_musculus")
示例2: test_add_new_species
# 需要导入模块: from cogent.db.ensembl.species import Species [as 别名]
# 或者: from cogent.db.ensembl.species.Species import getEnsemblDbPrefix [as 别名]
def test_add_new_species(self):
"""should correctly add a new species/common combination and infer the
correct ensembl prefix"""
species_name, common_name = "Otolemur garnettii", "Bushbaby"
Species.amendSpecies(species_name, common_name)
self.assertEqual(Species.getSpeciesName(species_name), species_name)
self.assertEqual(Species.getSpeciesName("Bushbaby"), species_name)
self.assertEqual(Species.getSpeciesName(common_name), species_name)
self.assertEqual(Species.getCommonName(species_name), common_name)
self.assertEqual(Species.getCommonName("Bushbaby"), common_name)
self.assertEqual(Species.getEnsemblDbPrefix("Bushbaby"), "otolemur_garnettii")
self.assertEqual(Species.getEnsemblDbPrefix(species_name), "otolemur_garnettii")
self.assertEqual(Species.getEnsemblDbPrefix(common_name), "otolemur_garnettii")
示例3: test_amend_existing
# 需要导入模块: from cogent.db.ensembl.species import Species [as 别名]
# 或者: from cogent.db.ensembl.species.Species import getEnsemblDbPrefix [as 别名]
def test_amend_existing(self):
"""should correctly amend an existing species"""
species_name = 'Ochotona princeps'
common_name1 = 'american pika'
common_name2 = 'pika'
ensembl_pref = 'ochotona_princeps'
Species.amendSpecies(species_name, common_name1)
self.assertEqual(Species.getCommonName(species_name),common_name1)
Species.amendSpecies(species_name, common_name2)
self.assertEqual(Species.getSpeciesName(common_name2), species_name)
self.assertEqual(Species.getSpeciesName(ensembl_pref), species_name)
self.assertEqual(Species.getCommonName(species_name), common_name2)
self.assertEqual(Species.getCommonName(ensembl_pref), common_name2)
self.assertEqual(Species.getEnsemblDbPrefix(species_name),ensembl_pref)
self.assertEqual(Species.getEnsemblDbPrefix(common_name2),ensembl_pref)