def test_rip(params): util.goto_dir(params['sim_dir']) print "> Pulse with RIP residue rotation" util.goto_dir('rip') simulate.pulse( params['ff'], '../md_merge/md', 'md', 2000, force.make_rip_fn(params['i_residue'], 300), 100)
def test_puff(params): util.goto_dir(params['sim_dir']) util.goto_dir('puff') print "> Pulse with terminii push" md = '../md_merge/md' n = get_n_protein_residues_from_restart(md) # make push function pulse_fn = force.make_puff_fn( [0, 1, 2], [n-3, n-2, n-1], 10.0, 0.1, 300) simulate.pulse(params['ff'], md, 'md', 2000, pulse_fn, 100)
def test_puff(params): util.goto_dir(params['sim_dir']) util.goto_dir('puff') print "> Pulse with terminii push" md = '../md_merge/md' n = get_n_protein_residues_from_restart(md) # make push function pulse_fn = force.make_puff_fn([0, 1, 2], [n - 3, n - 2, n - 1], 10.0, 0.1, 300) simulate.pulse(params['ff'], md, 'md', 2000, pulse_fn, 100)
def test_traj_analysis(params): util.goto_dir(params['sim_dir']) util.goto_dir('md1') trajectory.analyze_trajectory('md') util.check_output('md.rmsd.per_frame') util.check_output('md.rmsd.per_ps') trajectory.analyze_trajectory('md', analyzer_classes=[VelocityAnalyzer]) util.check_output('md.velocity.per_frame') util.check_output('md.velocity.per_ps')
def test_restraint(params): print "> Equil with restraints on " util.goto_dir(params['sim_dir']) util.goto_dir('restraint') in_md = '../md_merge/md' restraint_pdb = os.path.abspath('md.restraint.pdb') make_restraint_pdb( in_md, [params['i_residue']], restraint_pdb, is_backbone_only=False) simulate.langevin_thermometer( params['ff'], in_md, 1000, 300, 'md', 10, restraint_pdb=restraint_pdb)
def test_traj_analysis(params): util.goto_dir(params['sim_dir']) util.goto_dir('md1') trajectory.analyze_trajectory('md') util.check_output('md.rmsd.per_frame') util.check_output('md.rmsd.per_ps') trajectory.analyze_trajectory( 'md', analyzer_classes=[VelocityAnalyzer]) util.check_output('md.velocity.per_frame') util.check_output('md.velocity.per_ps')
def test_user_defined_pulse(params): util.goto_dir(params['sim_dir']) util.goto_dir('user_pulse') i, j = params['i_loop_start'], params['i_loop_end'] rotate_loop = RotateLoop(i, j, 0.7) print "> make restraint_pdb" restraint_pdb = os.path.abspath('md.restraint.pdb') in_md = '../md_merge/md' n = get_n_protein_residues_from_restart(in_md) residue_indices = range(0, i) + range(j, n) make_restraint_pdb(in_md, residue_indices, restraint_pdb) pulse_fn = lambda soup: rotate_loop.apply(soup) print "> Pulse with user-defined pulse_fn" simulate.pulse( params['ff'], '../md_merge/md', 'md', 5000, pulse_fn, 100, restraint_pdb=restraint_pdb)
def test_restraint(params): print "> Equil with restraints on " util.goto_dir(params['sim_dir']) util.goto_dir('restraint') in_md = '../md_merge/md' restraint_pdb = os.path.abspath('md.restraint.pdb') make_restraint_pdb(in_md, [params['i_residue']], restraint_pdb, is_backbone_only=False) simulate.langevin_thermometer(params['ff'], in_md, 1000, 300, 'md', 10, restraint_pdb=restraint_pdb)
def test_prepare_for_md(params): util.goto_dir(sim_dir) print os.getcwd() pdb = params['pdb'] fetch.get_pdbs_with_http(pdb) full_pdb = pdb + '.pdb' clean_pdb = os.path.abspath(pdb) + '.clean.pdb' pdbtext.clean_pdb(full_pdb, clean_pdb) print "> Generating topologies" simulate.pdb_to_top_and_crds(params['ff'], clean_pdb, 'sim') print "> Minimizing structure" util.goto_dir('min') simulate.minimize(params['ff'], '../sim', 'min')
def test_user_defined_pulse(params): util.goto_dir(params['sim_dir']) util.goto_dir('user_pulse') i, j = params['i_loop_start'], params['i_loop_end'] rotate_loop = RotateLoop(i, j, 0.7) print "> make restraint_pdb" restraint_pdb = os.path.abspath('md.restraint.pdb') in_md = '../md_merge/md' n = get_n_protein_residues_from_restart(in_md) residue_indices = range(0, i) + range(j, n) make_restraint_pdb(in_md, residue_indices, restraint_pdb) pulse_fn = lambda soup: rotate_loop.apply(soup) print "> Pulse with user-defined pulse_fn" simulate.pulse(params['ff'], '../md_merge/md', 'md', 5000, pulse_fn, 100, restraint_pdb=restraint_pdb)
def test_basic_md_merge(params): util.goto_dir(params['sim_dir']) print "> Fixed-temp1" util.goto_dir('md1') simulate.langevin_thermometer(params['ff'], '../min/min', 1000, 300, 'md', 10) print "> Fixed-temp2" util.goto_dir('../md2') simulate.langevin_thermometer(params['ff'], '../md1/md', 1000, 300, 'md', 10) print "> Merge temp1-temp2" util.goto_dir('../md_merge') simulate.merge_trajectories(params['ff'], 'md', ['../md1/md', '../md2/md'])
def test_basic_md_merge(params): util.goto_dir(params['sim_dir']) print "> Fixed-temp1" util.goto_dir('md1') simulate.langevin_thermometer( params['ff'], '../min/min', 1000, 300, 'md', 10) print "> Fixed-temp2" util.goto_dir('../md2') simulate.langevin_thermometer( params['ff'], '../md1/md', 1000, 300, 'md', 10) print "> Merge temp1-temp2" util.goto_dir('../md_merge') simulate.merge_trajectories( params['ff'], 'md', ['../md1/md', '../md2/md'])
import re from pdbremix import v3 from pdbremix import pdbatoms from pdbremix import simulate from pdbremix import force from pdbremix import util from pdbremix import pdbtext from pdbremix import trajectory from pdbremix import fetch from pdbremix import asa from pdbremix import data from pdbremix import rmsd util.goto_dir('pdb') # load the structures from the website fetch.get_pdbs_with_http('1be9', '1rzx') soup = pdbatoms.Soup('1be9.pdb') soup2 = pdbatoms.Soup('1rzx.pdb') # the structures loaded 1be9 and 1rzx are both PDZ # domains. However, they don't quite map to each other # This shows how you might select homologous residues # and then extract the coordinates for RMSD calculation def split_pairs(indices):
def test_rip(params): util.goto_dir(params['sim_dir']) print "> Pulse with RIP residue rotation" util.goto_dir('rip') simulate.pulse(params['ff'], '../md_merge/md', 'md', 2000, force.make_rip_fn(params['i_residue'], 300), 100)
import os import re from pdbremix import v3 from pdbremix import pdbatoms from pdbremix import simulate from pdbremix import force from pdbremix import util from pdbremix import pdbtext from pdbremix import trajectory from pdbremix import fetch from pdbremix import asa from pdbremix import data from pdbremix import rmsd util.goto_dir('pdb') # load the structures from the website fetch.get_pdbs_with_http('1be9', '1rzx') soup = pdbatoms.Soup('1be9.pdb') soup2 = pdbatoms.Soup('1rzx.pdb') # the structures loaded 1be9 and 1rzx are both PDZ # domains. However, they don't quite map to each other # This shows how you might select homologous residues # and then extract the coordinates for RMSD calculation def split_pairs(indices): for i in range(0, len(indices), 2): yield indices[i:i + 2]
for a in soup.atoms(): a.bfactor = 0.0 if a.res_type not in data.solvent_res_types: a.bfactor = 1.0 soup.write_pdb(pdb) sim_dir = "equilibrate" pdb_code = '1cph' ff = 'GROMACS4.5' pdb_code = '2evq' ff = 'AMBER11-GBSA' ff = 'GROMACS4.5' i_residue = 2 util.goto_dir(sim_dir) # Get the PDB files from the website fetch.get_pdbs_with_http(pdb_code) # Format the PDB file to give one single conformation clean_pdb = '2evq.clean.pdb' pdbtext.clean_pdb(pdb_code+'.pdb', clean_pdb) # Generate restart files from PDB simulate.pdb_to_top_and_crds(ff, clean_pdb, 'sim') # Make a protein positional restrain_protein.pdb file make_protein_restraint_pdb('sim', 'restrain_protein.pdb') # minimize system (mostly water) with protein positions fixed