当前位置: 首页>>代码示例>>Python>>正文


Python Species.getCommonName方法代码示例

本文整理汇总了Python中cogent.db.ensembl.species.Species.getCommonName方法的典型用法代码示例。如果您正苦于以下问题:Python Species.getCommonName方法的具体用法?Python Species.getCommonName怎么用?Python Species.getCommonName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cogent.db.ensembl.species.Species的用法示例。


在下文中一共展示了Species.getCommonName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_get_name_type

# 需要导入模块: from cogent.db.ensembl.species import Species [as 别名]
# 或者: from cogent.db.ensembl.species.Species import getCommonName [as 别名]
 def test_get_name_type(self):
     """should return the (latin|common) name given a latin, common or ensembl
     db prefix names"""
     self.assertEqual(Species.getSpeciesName("human"), "Homo sapiens")
     self.assertEqual(Species.getSpeciesName("homo_sapiens"), "Homo sapiens")
     self.assertEqual(Species.getCommonName("Mus musculus"), "Mouse")
     self.assertEqual(Species.getCommonName("mus_musculus"), "Mouse")
开发者ID:miklou,项目名称:pycogent,代码行数:9,代码来源:test_species.py

示例2: test_add_new_species

# 需要导入模块: from cogent.db.ensembl.species import Species [as 别名]
# 或者: from cogent.db.ensembl.species.Species import getCommonName [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")
开发者ID:miklou,项目名称:pycogent,代码行数:15,代码来源:test_species.py

示例3: test_amend_existing

# 需要导入模块: from cogent.db.ensembl.species import Species [as 别名]
# 或者: from cogent.db.ensembl.species.Species import getCommonName [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)
开发者ID:carze,项目名称:clovr-base,代码行数:17,代码来源:test_species.py

示例4: __repr__

# 需要导入模块: from cogent.db.ensembl.species import Species [as 别名]
# 或者: from cogent.db.ensembl.species.Species import getCommonName [as 别名]
 def __repr__(self):
     my_type = self.__class__.__name__
     name = _Species.getCommonName(self.Species)
     coord_type = self.CoordType
     c = '%s(%r,%r,%r,%d-%d,%d)'%(my_type, name, coord_type,
                 self.CoordName, self.Start, self.End, self.Strand)
     return c.replace("'", "")
开发者ID:GavinHuttley,项目名称:pycogent,代码行数:9,代码来源:assembly.py


注:本文中的cogent.db.ensembl.species.Species.getCommonName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。