import random
from libtbx import easy_run
import os

  
def run(model="3j0r_box.pdb"):
  for i in xrange(10):
    rs = str(random.randrange(1,9754365))
    cmd = " ".join([
        "phenix.dynamics",
        "%s"%model,
        "temperature=3000",
        "random_seed=%s"%rs,
        "number_of_steps=20000",
        "reference_coordinate_restraints.selection=all",
        "reference_coordinate_restraints.sigma=1.0",
        "stop_at_diff=0.5",
        "output_file_name_prefix=md_%s"%rs,
        ">& zlog_md_%s.log &"%str(i)])
    print cmd
    easy_run.call(cmd)

    
if (__name__ == "__main__"):
  run()
