本文整理汇总了Python中population.Population.microbiome_sequence_alignment方法的典型用法代码示例。如果您正苦于以下问题:Python Population.microbiome_sequence_alignment方法的具体用法?Python Population.microbiome_sequence_alignment怎么用?Python Population.microbiome_sequence_alignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类population.Population
的用法示例。
在下文中一共展示了Population.microbiome_sequence_alignment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from population import Population [as 别名]
# 或者: from population.Population import microbiome_sequence_alignment [as 别名]
def run(species_registry, env, pct_env, pct_pool, rep):
population = Population(species_registry, env, population_size, microbe_size, pct_env, pct_pool)
prefix = str(rep + 1) + "_"
sufix = "_E" + str(pct_env) + "_P" + str(pct_pool) + ".txt"
print "Output 5 result files in the format of: %s[****]%s" % (prefix, sufix)
file1 = open(prefix + "fixation" + sufix, 'w')
file2 = open(prefix + "gamma_diversity" + sufix, 'w')
file3 = open(prefix + "beta_diversity" + sufix, 'w')
file4 = open(prefix + "sum" + sufix, 'w')
file6 = open(prefix + "alpha_diversity" + sufix, 'w')
while population.number_of_generation <= number_of_generation:
population.sum_species()
if population.number_of_generation % number_generation_for_observation == 0:
# NOTE: separate summarise and get stats
# population.calcalute_all_stats()
# then use accessor to get values.
print >> file1, population.ratio_of_fixation()
print >> file4, population
print >> file6, population.get_alpha_diversity()
print >> file2, population.get_gamma_diversity()
population.microbiome_sequence_alignment()
population.segregating_site()
print >> file3, str(population.get_beta_diversity()) + '\t' + str(population.number_of_segregating_site)
population.get_next_gen()