temptarget = 1.0 # wrapper on VMD window via Pizza.py vmd tool # just proc 0 handles reading of dump file and viz if me == 0: from vmd import vmd v = vmd() v('menu main off') v.rep('VDW') from dump import dump from pdbfile import pdbfile d = dump('tmp.dump', 0) p = pdbfile(d) d.next() d.unscale() p.single(ntimestep) v.new('tmp.pdb', 'pdb') # display GUI with run/stop buttons and slider for temperature if me == 0: try: from Tkinter import * except: from tkinter import * tkroot = Tk() tkroot.withdraw() root = Toplevel(tkroot)
# (usually 1,2,3,4,5) # pdbfile = new PDB file # template = PDB file to use as template for creating new PDB file # this arg is optional, if not used a generic PDB file is created # Author: Steve Plimpton (Sandia), sjplimp at sandia.gov import sys,os path = os.environ["LAMMPS_PYTHON_TOOLS"] sys.path.append(path) from dump import dump from pdbfile import pdbfile if len(sys.argv) != 8 and len(sys.argv) != 9: raise StandardError, "Syntax: dump2pdb.py dumpfile Nid Ntype Nx Ny Nz pdbfile template" dumpfile = sys.argv[1] nid = int(sys.argv[2]) ntype = int(sys.argv[3]) nx = int(sys.argv[4]) ny = int(sys.argv[5]) nz = int(sys.argv[6]) pfile = sys.argv[7] if len(sys.argv) == 9: template = sys.argv[8] else: template = "" d = dump(dumpfile) d.map(nid,"id",ntype,"type",nx,"x",ny,"y",nz,"z") if template: p = pdbfile(template,d) else: p = pdbfile(d) p.one(pfile)
temptarget = 1.0 # wrapper on VMD window via Pizza.py vmd tool # just proc 0 handles reading of dump file and viz if me == 0: from vmd import vmd v = vmd() v('menu main off') v.rep('VDW') from dump import dump from pdbfile import pdbfile d = dump('tmp.dump',0) p = pdbfile(d) d.next() d.unscale() p.single(ntimestep) v.new('tmp.pdb','pdb') # display GUI with run/stop buttons and slider for temperature if me == 0: try: from Tkinter import * except: from tkinter import * tkroot = Tk() tkroot.withdraw() root = Toplevel(tkroot)
for line in pdbfile: if isatom.match(line): curatom = atom.Atom(line) oldfile.write(curatom.write_line()) curatom.bfac = bfacdict[myindex[int(curatom.resseq.strip())]] newfile.write(curatom.write_line()) else : oldfile.write(line) newfile.write(line) newfile.flush() oldfile.flush() counts() newfile.close() oldfile.close() if __name__=="__main__": try: p = OptionParser() p.add_option("--infile","-i",dest="pdbfile",metavar="*.pdb") p.add_option("--alignment" ,"-a",dest="alnfile",metavar="*.txt with alignment") opttuple,spillover = p.parse_args() pdb = pdbfile.pdbfile(opttuple.pdbfile) ad = pdb.make_atom_dict() read_clustal_make_dict(opttuple.alnfile) dictunme = get_property_by_resn() setbfac_property_clustal(open(opttuple.pdbfile)) except IOError: p.print_help() except TypeError: p.print_help()