def init():
     SeedSequence_Virus.init()
     SequenceEvolution_GTRGammaSeqGen.init()
     GC.seed_height = float(GC.seed_height)
     assert GC.seed_height > 0, "seed_height must be positive"
     assert GC.check_eval_str(GC.seed_speciation_rate_func), "Potentially dangerous seed_speciation_rate_func"
     GC.check_seqgen_executable()
 def init():
     SeedSequence_Virus.init()
     SequenceEvolution_GTRGammaSeqGen.init()
     GC.seed_birth_rate = float(GC.seed_birth_rate)
     assert GC.seed_birth_rate > 0, "seed_birth_rate must be positive"
     GC.seed_death_rate = float(GC.seed_death_rate)
     assert GC.seed_death_rate >= 0, "seed_death_rate must be at least 0"
     GC.check_seqgen_executable()
     try:
         global treesim
         from dendropy.simulate import treesim
     except:
         from os import chdir
         chdir(GC.START_DIR)
         assert False, "Error loading DendroPy. Install with: pip3 install dendropy"
Esempio n. 3
0
 def init():
     SeedSequence_Virus.init()
     SequenceEvolution_GTRGammaSeqGen.init()
     GC.seed_population = float(GC.seed_population)
     assert GC.seed_population > 0, "seed_population must be positive"
     GC.check_seqgen_executable()
     try:
         global TaxonNamespace
         from dendropy import TaxonNamespace
         global treesim
         from dendropy.simulate import treesim
     except:
         from os import chdir
         chdir(GC.START_DIR)
         assert False, "Error loading DendroPy. Install with: pip3 install dendropy"
 def init():
     GC.seqgen_path = expanduser(GC.seqgen_path.strip())
     GC.seqgen_args = GC.seqgen_args.strip()
     assert '-d' not in GC.seqgen_args, "Do not use the Seq-Gen -d argument"
     assert '-k' not in GC.seqgen_args, "Do not use the Seq-Gen -k argument"
     assert '-l' not in GC.seqgen_args, "Do not use the Seq-Gen -l argument"
     assert '-n' not in GC.seqgen_args, "Do not use the Seq-Gen -n argument"
     assert '-o' not in GC.seqgen_args, "Do not use the Seq-Gen -o argument"
     assert '-p' not in GC.seqgen_args, "Do not use the Seq-Gen -p argument"
     assert '-s' not in GC.seqgen_args, "Do not use the Seq-Gen -s argument"
     assert '-m' in GC.seqgen_args, "Must specify a Seq-Gen model using the -m argument"
     mode = GC.seqgen_args.split('-m')[1].strip().split(' ')[0]
     assert mode in SEQGEN_MODES.split(', '), "Invalid Seq-Gen model (%s). Options: %s" % (mode,SEQGEN_MODES)
     GC.check_seqgen_executable()
     try:
         global read_tree_newick
         from treeswift import read_tree_newick
     except:
         from os import chdir
         chdir(GC.START_DIR)
         assert False, "Error loading TreeSwift. Install with: pip3 install treeswift"
 def init():
     GC.msms_path = expanduser(GC.msms_path.strip())
     assert MF.modules[
         'ContactNetworkGenerator'].__name__ in GC.COMMUNITY_GENERATORS, "Must use a ContactNetworkGenerator that creates communities (%s)" % ', '.join(
             sorted(GC.COMMUNITY_GENERATORS))
     SeedSequence_Virus.init()
     SequenceEvolution_GTRGammaSeqGen.init()
     GC.community_seed_scaled_mutation_rate = float(
         GC.community_seed_scaled_mutation_rate)
     assert GC.community_seed_scaled_mutation_rate > 0, "community_seed_scaled_mutation_rate must be positive"
     assert isinstance(
         GC.community_seed_populations, list
     ), "community_seed_populations must be a list of positive integers"
     for i in range(len(GC.community_seed_populations)):
         GC.community_seed_populations[i] = int(
             GC.community_seed_populations[i])
         assert GC.community_seed_populations[
             i] > 0, "community_seed_populations must be a list of positive integers"
     assert isinstance(
         GC.community_seed_migration_rates, dict
     ), "community_seed_migration_rates must be a dictionary of dictionaries of floats"
     try:
         for i in range(len(GC.community_seed_populations)):
             for j in range(len(GC.community_seed_migration_rates)):
                 if i == j:
                     assert i not in GC.community_seed_migration_rates[
                         i] or float(
                             GC.community_seed_migration_rates[i][i]
                         ) == 0., "Non-zero self-migration rate found in community_seed_migration_rates"
                 else:
                     GC.community_seed_migration_rates[i][j] = float(
                         GC.community_seed_migration_rates[i][j])
                     assert GC.community_seed_migration_rates[i][
                         j] >= 0, "Migration rates in community_seed_migration_rates must be at least 0"
     except KeyError:
         assert False, "Malformed community_seed_migration_rates dictionary. See FAVITES Wiki for usage information"
     GC.check_seqgen_executable()
 def init():
     SeedSequence_Virus.init()
     SequenceEvolution_GTRGammaSeqGen.init()
     GC.seed_height = float(GC.seed_height)
     assert GC.seed_height > 0, "seed_height must be positive"
     GC.check_seqgen_executable()