コード例 #1
0
ファイル: dump_database.py プロジェクト: cjforman/pele
def main():
    parser = argparse.ArgumentParser(description="print information about the database")

    parser.add_argument("database", type=str, help="Database file name")
    
    parser.add_argument("--write-disconnect",
                      dest="writeDPS", action="store_true",
                      help="generate min.dat and ts.dat to use with disconnectDPS")
    parser.add_argument("-m",
                      dest="writeMinima", action="store_true",
                      help="dump minima to screen")
    parser.add_argument("-t",
                      dest="writeTS", action="store_true",
                      help="dump transition states to screen")
    parser.add_argument("-p",
                      dest="properties", action="store_true",
                      help="print system properties")
    parser.add_argument("-s",
                      dest="summary", action="store_true",
                      help="print summary")
    parser.add_argument("-S",
                      dest="summary_long", action="store_true",
                      help="print long summary")
    args = parser.parse_args()
    
    if args.summary_long:
        args.summary = True
        
    db = Database(db=args.database, createdb=False)

    if args.properties or args.summary:
        print_system_properties(db)

    if args.summary:
        print "number of minima:", db.number_of_minima()
        print "number of transition states:", db.number_of_transition_states()
  
    if args.summary_long:
        long_summary(db)
        
    if args.writeMinima:
        print "List of minima: energy id fvib pgorder"
        print "---------------"
        for m in db.minima():
            print "%f\t\tid %d %s %s" % (m.energy, m._id, str(m.fvib), str(m.pgorder))
        print "END\n"
    
    if args.writeTS:
        print "List of transition states:"
        print "--------------------------"
        for ts in db.transition_states():
            print "%d\t<->\t%d\tid %d\tenergies %f %f %f" % \
                (ts.minimum1._id, ts.minimum2._id, ts._id, ts.minimum1.energy, ts.energy, ts.minimum2.energy)
        print "END\n"

    if args.writeDPS:
        writeDPS(db)
コード例 #2
0
ファイル: dump_database.py プロジェクト: Mahdisadjadi/pele
def main():
    parser = argparse.ArgumentParser(description="print information about the database")

    parser.add_argument("database", type=str, help="Database file name")
    
    parser.add_argument("--write-pathsample-db",
                      dest="write_pathsample", action="store_true",
                      help="generate a pathsample database by writing files min.data, ts.data, points.min, and points.ts")
    parser.add_argument("-m",
                      dest="writeMinima", action="store_true",
                      help="dump minima to screen")
    parser.add_argument("-t",
                      dest="writeTS", action="store_true",
                      help="dump transition states to screen")
    parser.add_argument("-p",
                      dest="properties", action="store_true",
                      help="print system properties")
    parser.add_argument("-s",
                      dest="summary", action="store_true",
                      help="print summary")
    parser.add_argument("-S",
                      dest="summary_long", action="store_true",
                      help="print long summary")
    args = parser.parse_args()
    
    if args.summary_long:
        args.summary = True
        
    db = Database(db=args.database, createdb=False)

    if args.properties or args.summary:
        print_system_properties(db)

    if args.summary:
        print "number of minima:", db.number_of_minima()
        print "number of transition states:", db.number_of_transition_states()
  
    if args.summary_long:
        long_summary(db)
        
    if args.writeMinima:
        print "List of minima: energy id fvib pgorder"
        print "---------------"
        for m in db.minima():
            print "%f\t\tid %d %s %s" % (m.energy, m._id, str(m.fvib), str(m.pgorder))
        print "END\n"
    
    if args.writeTS:
        print "List of transition states:"
        print "--------------------------"
        for ts in db.transition_states():
            print "%d\t<->\t%d\tid %d\tenergies %f %f %f" % \
                (ts.minimum1._id, ts.minimum2._id, ts._id, ts.minimum1.energy, ts.energy, ts.minimum2.energy)
        print "END\n"

    if args.write_pathsample:
        write_pathsample_db(db)
コード例 #3
0
ファイル: dump_database.py プロジェクト: yangxi1209/pele
def main():
    # add some program options
    parser = OptionParser(usage = "usage: %prog [options] storage")
        
    parser.add_option("--write-disconnect",
                      dest="writeDPS", action="store_true",
                      help="generate min.dat and ts.dat to use with disconnectDPS")
    parser.add_option("-m",
                      dest="writeMinima", action="store_true",
                      help="dump minima to screen")
    parser.add_option("-t",
                      dest="writeTS", action="store_true",
                      help="dump transition states to screen")
    parser.add_option("--cif",
                  dest="writeCIF", action="store_true",
                  help="export cif files")
    parser.add_option("--cif-dir",
                  dest="cifDir", default=".", action="store",type="string",
                  help="directory to write cifs to")

    (options, args) = parser.parse_args()
    
    # print help if no input file is given
    if(len(args) != 1):
        parser.print_help()
        exit(-1)
        
    db = Database(db=args[0])

    if(options.writeMinima):
        print "List of minima:"
        print "---------------"
        for m in db.minima():
            print "%f\t\tid %d"%(m.energy, m._id)
        print "END\n"
    
    if(options.writeTS):
        print "List of transition states:"
        print "--------------------------"
        for ts in db.transition_states():
            print "%d\t<->\t%d\tid %d\tenergies %f %f %f"%\
                (ts.minimum1._id, ts.minimum2._id, ts._id, ts.minimum1.energy, ts.energy, ts.minimum2.energy)
        print "END\n"
        
    if(options.writeDPS):
        writeDPS(db)
        
    if(options.writeCIF):
        GMIN.initialize()
        i=0
        for m in db.minima():
            i+=1
            filename = options.cifDir+"/lowest%03d.cif"%(i)
            print "minimum",i, "energy",m.energy,"to",filename
            GMIN.writeCIF(filename, m.coords, "E"+str(m.energy))
コード例 #4
0
ファイル: dump.py プロジェクト: yangxi1209/pele
def main():
    # add some program options
    parser = OptionParser(usage="usage: %prog [options] storage")

    parser.add_option(
        "--write-disconnect",
        dest="writeDPS",
        action="store_true",
        help="generate min.dat and ts.dat to use with disconnectDPS")
    parser.add_option("-m",
                      dest="writeMinima",
                      action="store_true",
                      help="dump minima to screen")
    parser.add_option("-t",
                      dest="writeTS",
                      action="store_true",
                      help="dump transition states to screen")
    parser.add_option("--coords",
                      dest="writeCoords",
                      action="store_true",
                      help="export coordinates files")
    parser.add_option("--xyz",
                      dest="writeXYZ",
                      action="store_true",
                      help="export xyz files")

    (options, args) = parser.parse_args()

    # print help if no input file is given
    if (len(args) != 1):
        parser.print_help()
        exit(-1)

    db = Database(db=args[0])

    if (options.writeMinima):
        print "List of minima:"
        print "---------------"
        for m in db.minima():
            print "%f\t\tid %d" % (m.energy, m._id)
        print "END\n"

    if (options.writeTS):
        print "List of transition states:"
        print "--------------------------"
        for ts in db.transition_states():
            print "%d\t<->\t%d\tid %d\tenergies %f %f %f"%\
                (ts.minimum1._id, ts.minimum2._id, ts._id, ts.minimum1.energy, ts.energy, ts.minimum2.energy)
        print "END\n"

    if (options.writeDPS):
        writeDPS(db)
    if (options.writeCoords):
        GMIN.initialize()
        i = 0
        for m in db.minima():
            i += 1
            filename = "lowest/lowest%03d.cif" % (i)
            print "minimum", i, "energy", m.energy, "to", filename
            GMIN.userpot_dump(filename, m.coords)
            if (not TO_PDB is None):
                os.system(TO_PDB % filename)
            np.savetxt("lowest/coords_%03d.txt" % (i), m.coords)

    if (options.writeXYZ):
        traj = open("lowest/traj.xyz", "w")
        i = 0
        for m in db.minima():
            i += 1
            filename = "lowest/lowest%03d.xyz" % (i)
            print "minimum", i, "energy", m.energy, "to", filename
            export_xyz(open(filename, "w"), m.coords)
            export_xyz(traj, m.coords)

        traj.close()
コード例 #5
0
ファイル: dump.py プロジェクト: Mahdisadjadi/pele
def main():
    # add some program options
    parser = OptionParser(usage = "usage: %prog [options] storage")
        
    parser.add_option("--write-disconnect",
                      dest="writeDPS", action="store_true",
                      help="generate min.dat and ts.dat to use with disconnectDPS")
    parser.add_option("-m",
                      dest="writeMinima", action="store_true",
                      help="dump minima to screen")
    parser.add_option("-t",
                      dest="writeTS", action="store_true",
                      help="dump transition states to screen")
    parser.add_option("--coords",
                  dest="writeCoords", action="store_true",
                  help="export coordinates files")
    parser.add_option("--xyz",
                  dest="writeXYZ", action="store_true",
                  help="export xyz files")

    (options, args) = parser.parse_args()
    
    # print help if no input file is given
    if(len(args) != 1):
        parser.print_help()
        exit(-1)
        
    db = Database(db=args[0])

    if(options.writeMinima):
        print "List of minima:"
        print "---------------"
        for m in db.minima():
            print "%f\t\tid %d"%(m.energy, m._id)
        print "END\n"
    
    if(options.writeTS):
        print "List of transition states:"
        print "--------------------------"
        for ts in db.transition_states():
            print "%d\t<->\t%d\tid %d\tenergies %f %f %f"%\
                (ts.minimum1._id, ts.minimum2._id, ts._id, ts.minimum1.energy, ts.energy, ts.minimum2.energy)
        print "END\n"
        
    if(options.writeDPS):
        writeDPS(db)
    if(options.writeCoords):
        GMIN.initialize()
        i=0
        for m in db.minima():
            i+=1
            filename = "lowest/lowest%03d.cif"%(i)
            print "minimum",i, "energy",m.energy,"to",filename
            GMIN.userpot_dump(filename, m.coords)            
            if(not TO_PDB is None):
                os.system(TO_PDB%filename)
            np.savetxt("lowest/coords_%03d.txt"%(i), m.coords)
            
    if(options.writeXYZ):
        traj=open("lowest/traj.xyz", "w")
        i=0
        for m in db.minima():
            i+=1
            filename = "lowest/lowest%03d.xyz"%(i)
            print "minimum",i, "energy",m.energy,"to",filename
            export_xyz(open(filename, "w"), m.coords)
            export_xyz(traj, m.coords)

        traj.close()
コード例 #6
0
ファイル: dump_database.py プロジェクト: sniblett402/pele
def main():
    parser = argparse.ArgumentParser(description="print information about the database")

    parser.add_argument("database", type=str, help="Database file name")
    
    parser.add_argument("--write-pathsample-db",
                      dest="write_pathsample", action="store_true",
                      help="generate a pathsample database by writing files min.data, ts.data, points.min, and points.ts")
    parser.add_argument("--write-dummy-db",
                      dest="write_pathsample_dummy", action="store_true",
                      help="generate a pathsample database without the points files - min.data and ts.data only")
    parser.add_argument("-m",
                      dest="writeMinima", action="store_true",
                      help="dump minima to screen")
    parser.add_argument("--minimum", type=int, default=0, help="print the coordinates of a particular minimum to the screen")
    parser.add_argument("-t",
                      dest="writeTS", action="store_true",
                      help="dump transition states to screen")
    parser.add_argument("-p",
                      dest="properties", action="store_true",
                      help="print system properties")
    parser.add_argument("-s",
                      dest="summary", action="store_true",
                      help="print summary")
    parser.add_argument("-S",
                      dest="summary_long", action="store_true",
                      help="print long summary")
    parser.add_argument("-l",
                      dest="long_output", action="store_true",
                      help="Allow long output to be printed")
    args = parser.parse_args()
    
    if args.summary_long:
        args.summary = True
    
    suppress = not args.long_output
        
    db = Database(db=args.database, createdb=False)

    if args.properties or args.summary:
        print_system_properties(db,suppress_long=suppress)

    if args.summary:
        print "number of minima:", db.number_of_minima()
        print "number of transition states:", db.number_of_transition_states()
  
    if args.summary_long:
        long_summary(db)
        
    if args.minimum > 0:
       m = db.getMinimum(args.minimum)
       print m.energy, m._id
       x = m.coords.reshape(-1,3)
       print x

    if args.writeMinima:
        print "List of minima: energy id fvib pgorder"
        print "---------------"
        for m in db.minima():
            print "%f\t\tid %d %s %s" % (m.energy, m._id, str(m.fvib), str(m.pgorder))
        print "END\n"
    
    if args.writeTS:
        print "List of transition states:"
        print "--------------------------"
        for ts in db.transition_states():
            print "%d\t<->\t%d\tid %d\tenergies %f %f %f" % \
                (ts.minimum1._id, ts.minimum2._id, ts._id, ts.minimum1.energy, ts.energy, ts.minimum2.energy)
        print "END\n"

    if args.write_pathsample:
        write_pathsample_db(db)
    elif args.write_pathsample_dummy:
        write_pathsample_db(db, False)