How to use the parmed.amber.Rst7 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 MobleyLab / blues / blues / settings.py View on Github external
Parameters
        -----------
        filename: str, filepath to input (.prmtop)
        restart: str, file path to Amber restart file (.rst7)
        logger: logging.Logger object, records information

        Notes
        -----
        Reference for parmed.load_Structure *args and **kwargs
        https://parmed.github.io/ParmEd/html/structobj/parmed.formats.registry.load_file.html#parmed.formats.registry.load_file
        """
        if 'restart' in config['structure'].keys():
            rst7 = config['structure']['restart']
            config['Logger'].info('Restarting simulation from {}'.format(rst7))
            restart = parmed.amber.Rst7(rst7)
            config['structure'].pop('restart')

            structure = parmed.load_file(**config['structure'])
            structure.positions = restart.positions
            structure.velocities = restart.velocities
            structure.box = restart.box
        else:
            structure = parmed.load_file(**config['structure'])

        config['Structure'] = structure
        return config
github MobleyLab / blues / blues / settings.py View on Github external
Parameters
        -----------
        filename: str, filepath to input (.prmtop)
        restart: str, file path to Amber restart file (.rst7)
        logger: logging.Logger object, records information

        Notes
        -----
        Reference for parmed.load_Structure *args and **kwargs
        https://parmed.github.io/ParmEd/html/structobj/parmed.formats.registry.load_file.html#parmed.formats.registry.load_file
        """
        if 'restart' in config['structure'].keys():
            rst7 = config['structure']['restart']
            config['Logger'].info('Restarting simulation from {}'.format(rst7))
            restart = parmed.amber.Rst7(rst7)
            config['structure'].pop('restart')

            structure = parmed.load_file(**config['structure'])
            structure.positions = restart.positions
            structure.velocities = restart.velocities
            structure.box = restart.box
        else:
            structure = parmed.load_file(**config['structure'])

        config['Structure'] = structure
        return config