本文整理汇总了Python中simulation.Simulation.save_simulation方法的典型用法代码示例。如果您正苦于以下问题:Python Simulation.save_simulation方法的具体用法?Python Simulation.save_simulation怎么用?Python Simulation.save_simulation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simulation.Simulation
的用法示例。
在下文中一共展示了Simulation.save_simulation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SimParameters
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import save_simulation [as 别名]
parser = argparse.ArgumentParser(
description="Simulates rearrangement evolution on a given newick tree")
parser.add_argument("-s", "--sim", type=int, help="Simulate a new birth_death with SIM species")
parser.add_argument("-n", "--num_genes", type=int, default=100, help="Number of genes in the root genome.")
parser.add_argument("-c", "--num_chr", type=int, default=5, help="Number of chromosomes in the root genome.")
parser.add_argument("-L", "-dl", "--duplication_length", type=int, default=5, help="Maximum length of duplication event.")
parser.add_argument("-D", "--rearrangements", type=int, default=5, help="Number of rearrangements.")
parser.add_argument("-o", "--output", type=str, default="sim", help="Name of the output folder.")
parser.add_argument("-dp", "--deletion_p", type=float, default=0.0, help="Percentage of deletions, from 0 to 1.0")
parser.add_argument("-ip", "--insertion_p", type=float, default=0.0, help="Percentage of insertions, from 0 to 1.0")
parser.add_argument("-il", "--indel_length", type=int, default=5, help="Maximum size of indel event in genes.")
parser.add_argument("-d", "--disturb", type=float, default=0,
help="Disturb branch lengths multiplying each by e^r, where r in [-d,+d]. ")
param = parser.parse_args()
# Simulation parameters:
sim_par = SimParameters(num_genes=param.num_genes, num_chr=param.num_chr,
del_p=param.deletion_p, ins_p=param.insertion_p, indel_length=param.indel_length,
duplication_length=param.duplication_length)
# start sim object;
sim = Simulation(param.output, sim_par)
sim.simulate_tree(param.sim)
run_L_D_simulation(sim, param.duplication_length, param.rearrangements)
sim.save_simulation(save_copies=True)