Exemple #1
0
def run_short_ci(model_input, cuda_device_index, long_check=True):
    start_dir = os.getcwd()
    model, xml_path = prepare.prepare(model_input, force_overwrite=False)

    model_dir = os.path.dirname(xml_path)
    model.anchor_rootdir = os.path.abspath(model_dir)
    check.check_pre_simulation_all(model)
    run.run(model,
            "any",
            min_b_surface_simulation_length=1000,
            num_rev_launches=10,
            cuda_device_index=cuda_device_index,
            save_state_file=True)
    data_sample_list = converge.converge(model, k_on_state=0)
    rmsd_convergence_results = common_converge.calc_RMSD_conv_amount(
        model, data_sample_list)
    transition_minima, transition_details, transition_times \
        = common_converge.calc_transition_steps(
        model, data_sample_list[-1])
    converge.print_convergence_results(
        model,
        rmsd_convergence_results,
        cutoff=0.1,
        transition_results=transition_details,
        transition_time_results=transition_times,
        minimum_anchor_transitions=10,
        bd_transition_counts=data_sample_list[-1].bd_transition_counts)
    check.check_post_simulation_all(model, long_check=long_check)
    analysis = analyze.analyze(model)
    analysis.print_results()
    os.chdir(start_dir)
    return
Exemple #2
0
def test_run_planar(planar_mmvt_model):
    check.check_pre_simulation_all(planar_mmvt_model)
    run.run(planar_mmvt_model,
            "1",
            min_total_simulation_length=10,
            force_overwrite=True)
    check.check_post_simulation_all(planar_mmvt_model)
Exemple #3
0
def test_run_tiwary(tiwary_mmvt_model):
    check.check_pre_simulation_all(tiwary_mmvt_model)
    run.run(tiwary_mmvt_model,
            "0",
            min_total_simulation_length=10,
            force_overwrite=True)
    check.check_post_simulation_all(tiwary_mmvt_model)
Exemple #4
0
def test_normal_run_openmm(toy_mmvt_model):
    """
    Test a normal toy run - no restarts or anything.
    """
    num_steps = 10000
    dcd_interval = toy_mmvt_model.calculation_settings\
        .trajectory_reporter_interval
    num_dcd_frames = num_steps // dcd_interval
    toy_mmvt_model.calculation_settings.num_production_steps = num_steps
    toy_mmvt_model.openmm_settings.cuda_platform_settings = None
    toy_mmvt_model.openmm_settings.reference_platform = True
    check.check_pre_simulation_all(toy_mmvt_model)
    run.run(toy_mmvt_model, "any", force_overwrite=True)
    check.check_post_simulation_all(toy_mmvt_model)
    for anchor in toy_mmvt_model.anchors:
        if anchor.bulkstate:
            continue
        checkpoint_step = get_checkpoint_step(toy_mmvt_model, anchor)
        assert checkpoint_step == num_steps

        dcd_length, dcd_file_number = get_trajectory_length(
            toy_mmvt_model, anchor)
        dummy_file = tempfile.NamedTemporaryFile()
        num_swarm = mmvt_sim_openmm.\
            get_starting_structure_num_frames(toy_mmvt_model, anchor,
                                              dummy_file.name)
        assert dcd_length == num_dcd_frames * num_swarm

    return
Exemple #5
0
 argparser.add_argument(
     "-T", "--maximum_time", dest="maximum_time", default=None, type=float,
     help="A user may wish to stop the analysis of simulation time for "\
     "each anchor at a particular time. Enter the time (in ps) at which to "\
     "end the analysis at a given anchor if the simulation time exceeds it.")
 
 args = argparser.parse_args() # parse the args into a dictionary
 args = vars(args)
 model_file = args["model_file"]
 force_warning = args["force_warning"]
 num_error_samples = args["num_error_samples"]
 stride_error_samples = args["stride_error_samples"]
 skip_error_samples = args["skip_error_samples"]
 image_directory = args["image_directory"]
 skip_checks = args["skip_checks"]
 min_time = args["minimum_time"]
 max_time = args["maximum_time"]
 model = base.load_model(model_file)
 image_directory = common_analyze.make_image_directory(
     model, image_directory)
 if not skip_checks:
     check.check_post_simulation_all(model, long_check=True)
 
 analysis = analyze(model, force_warning=force_warning, 
         num_error_samples=num_error_samples, 
         stride_error_samples=stride_error_samples,
         skip_error_samples=skip_error_samples, 
         skip_checks=skip_checks, min_time=min_time, max_time=max_time)
 analysis.print_results()
 print("All plots being saved to:", image_directory)
 analysis.save_plots(image_directory)
Exemple #6
0
def test_run_elber(toy_elber_model):
    check.check_pre_simulation_all(toy_elber_model)
    run.run(toy_elber_model, "0", min_total_simulation_length=1000)
    check.check_post_simulation_all(toy_elber_model)