How to use the parmed.amber function in ParmEd

To help you get started, we’ve selected a few ParmEd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github slochower / pAPRika / paprika / restraints / restraints.py View on Github external
A static restraint.

    """

    # Check num_window_list
    if len(num_window_list) != 3:
        raise ValueError(
            "The num_window_list needs to contain three integers corresponding to the number of windows in the "
            "attach, pull, and release phase, respectively "
        )

    rest = DAT_restraint()
    rest.continuous_apr = continuous_apr
    rest.amber_index = amber_index

    if isinstance(ref_structure, pmd.amber._amberparm.AmberParm):
        reference_trajectory = pt.load_parmed(ref_structure, traj=True)
        rest.topology = ref_structure
    elif isinstance(ref_structure, str):
        reference_trajectory = pt.iterload(ref_structure, traj=True)
        rest.topology = pmd.load_file(ref_structure, structure=True)
    else:
        raise TypeError(
            "static_DAT_restraint does not support the type associated with ref_structure:"
            + type(ref_structure)
        )

    rest.mask1 = restraint_mask_list[0]
    rest.mask2 = restraint_mask_list[1]
    if len(restraint_mask_list) >= 3:
        rest.mask3 = restraint_mask_list[2]
    if len(restraint_mask_list) == 4: