#### Read in input topology, trajectory files, outTraj file
    top_file = sys.argv[1]
    traj_file = sys.argv[2]
    out_traj_file = sys.argv[3]
    if ("-crys" in sys.argv):
        include_crys = True
    else:
        include_crys = False

    #### load topology and trajectories
    traj_molid = molecule.load('pdb', top_file)
    molecule.read(traj_molid, 'netcdf', traj_file, beg=0, end=-1, waitfor=-1)

    #### align all frames
    refsel = atomsel("protein", molid=traj_molid, frame=0)
    for i in range(molecule.numframes(traj_molid)):
        molecule.set_frame(traj_molid, i)
        b = atomsel("protein", molid=traj_molid, frame=i)
        T = b.fit(refsel)
        atomsel("all", molid=traj_molid, frame=i).move(T)

    #### Read out file
    if (include_crys == True):
        molecule.write(traj_molid, 'dcd', out_traj_file, beg=0, end=-1)
    else:
        molecule.write(traj_molid, 'dcd', out_traj_file, beg=1, end=-1)

    toc = time.clock()
    print("Time for wrapAlign.py = " + str(toc - tic))
Exemple #2
0
 def setFrame(self, frame):
   """ Set the coordinate frame to the given value.  Must be in the range
   [0, numFrames())"""
   molecule.set_frame(self.id, frame)
   return self
Exemple #3
0
 def setFrame(self, frame):
     """ Set the coordinate frame to the given value.  Must be in the range
 [0, numFrames())"""
     molecule.set_frame(self.id, frame)
     return self