Example #1
0
def withPbc(testfile="supper.pdb", args=''):
    a = Pdb(testfile)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    b.assignIdNumbers()
    b.toFrac()
    #b.translate(12.0, "z")
    toXyz(b, "out.xyz")
    toMusic(b, "out.music")
    if len(b.pbc) == 0:
        b.geotag = "BIOGRF 200"
    else:
        b.geotag = "XTLGRF 200"
    toReaxLammps(b, "lammps.data")
    toGeo(b, "sim.geo")
    toMsd(b, "sim.msd")
    toPoscar(b, )
    toCfg(b, )
    toJdft(b, )
    toTowheecoords(b)
    if args:
        if args.element:
            toPdb(b, "out.pdb", 1)
    else:
        toPdb(b, "out.pdb")
Example #2
0
def convertors(b):
    #toGeo(b, b.name+'.geo')
    toGeo(b, 'geo')
    toXyz(b, b.name+'.xyz')
    toGjf(b, b.name+'.gjf')
    toPdb(b, b.name+'.pdb')
    toReaxLammps(b)
Example #3
0
def convert(fname):
    a = Jaguar(fname)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    toXyz(b, "out.xyz")
    toPdb(b, "output.pdb", 1)
    toReaxLammps(b, "lammps.data")
Example #4
0
def convert(fname):
    a = Jaguar(fname)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    toXyz(b, "out.xyz")
    toPdb(b, "output.pdb", 1)
    toReaxLammps(b, "lammps.data")
Example #5
0
def surface_atoms_read(b):
    sur = np.loadtxt("sur_sas.dat")
    b1 = copy.deepcopy(b)
    atoms = []
    for i in range(len(sur)):
        if int(sur[i]) == 1:
            atoms.append(b.atoms[i])
    b1.atoms = atoms
    toPdb(b1, "surface_atoms.pdb")
    toXyz(b1, "surface_atoms.xyz")
Example #6
0
def surface_atoms_read(b):
    sur = np.loadtxt("sur_sas.dat")
    b1 = copy.deepcopy(b)
    b2 = copy.deepcopy(b)
    atoms_sur = []
    atoms_bulk = []
    for i in range(len(sur)):
        if int(sur[i]) == 1:
            atoms_sur.append(b.atoms[i])
        else:
            atoms_bulk.append(b.atoms[i])
    b1.atoms = atoms_sur
    b2.atoms = atoms_bulk
    toPdb(b1, "surface_atoms.pdb")
    toXyz(b1, "surface_atoms.xyz")
    toPdb(b2, "bulk_atoms.pdb")
    toXyz(b2, "bulk_atoms.xyz")
Example #7
0
def surface_atoms_read(b):
    sur = np.loadtxt("sur_sas.dat")
    b1 = copy.deepcopy(b)
    b2 = copy.deepcopy(b)
    atoms_sur = []
    atoms_bulk = []
    for i in range(len(sur)):
        if int(sur[i]) == 1:
            atoms_sur.append(b.atoms[i])
        else:
            atoms_bulk.append(b.atoms[i])
    b1.atoms = atoms_sur
    b2.atoms = atoms_bulk
    toPdb(b1, "surface_atoms.pdb")
    toXyz(b1, "surface_atoms.xyz")
    toPdb(b2, "bulk_atoms.pdb")
    toXyz(b2, "bulk_atoms.xyz")
Example #8
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("fname", default="POSCAR", nargs="?", help="geo file name")
    args = parser.parse_args()
    
    poscar_file = args.fname
    a = Poscar(poscar_file)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    print b.getVol()
    #print b.pbc
    
    toXyz(b)
    toGeo(b, "geo")
    toPdb(b, "sim.pdb")
    toReaxLammps(b, "lammps.data")
    toJdft(b, "coords")
Example #9
0
def surface_atoms_cut_off(b):
    """
    """
    cn = np.loadtxt("cn.dat")
    o = open("sur.dat", "w")
    n_cut = 10
    sur = np.where(cn <= 10, 1, 0)

    b1 = copy.deepcopy(b)
    atoms = []
    for i in range(len(sur)):
        if sur[i] == 1:
            atoms.append(b.atoms[i])
            o.write("1\n")
        else:
            o.write("0\n")
    o.close()
    b1.atoms = atoms
    toPdb(b1, "surface_atoms.pdb")
    toXyz(b1, "surface_atoms.xyz")
Example #10
0
def surface_atoms_cut_off(b):
    """
    """
    cn = np.loadtxt("cn.dat")
    o = open("sur.dat", "w")
    n_cut = 10
    sur = np.where(cn <= 10, 1, 0)
    
    b1 = copy.deepcopy(b)
    atoms = []
    for i in range(len(sur)):
        if sur[i] == 1:
            atoms.append(b.atoms[i])
            o.write("1\n")
        else:
            o.write("0\n")
    o.close()
    b1.atoms = atoms
    toPdb(b1, "surface_atoms.pdb")
    toXyz(b1, "surface_atoms.xyz")
Example #11
0
def withPbc(testfile="supper.pdb", args=''):
    a = Pdb(testfile)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    #b.translate(12.0, "z")
    toXyz(b, "out.xyz")
    toMusic(b, "out.music")
    if len(b.pbc) == 0:
        b.geotag = "BIOGRF 200"
    else:
        b.geotag = "XTLGRF 200"
    toReaxLammps(b, "lammps.data")
    toGeo(b, "sim.geo")
    toMsd(b, "sim.msd")
    if args:
        if args.element:
            toPdb(b, "out.pdb", 1)
    else:
        toPdb(b, "out.pdb")
Example #12
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("fname", default="POSCAR", nargs="?", help="geo file name")
    args = parser.parse_args()
    
    poscar_file = args.fname
    a = Poscar(poscar_file)
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    vol = b.getVol()
    mass = b.getMass()
    density = mass/vol*ATOMIC_MASS_CONSTANT*1e27
    print density
    #print b.pbc
    
    toXyz(b, "contcar.xyz")
    toGeo(b, "geo")
    toPdb(b, "sim.pdb")
    toReaxLammps(b, "lammps.data")
    toJdft(b, "coords")
Example #13
0
""" parse the geo file with multi configuration into
seperated files
"""
import os
from utilities import parseBlock
from mytype import System, Molecule, Atom
from geo import Geo
from output_conf import toGeo
from output_conf import toXyz

os.chdir("/home/tao/Documents/debug/geofile")
parseBlock("geo", 1)
for i in range(204):
    fname = "out%03d" % i
    a = Geo(fname)
    b = a.parser()
    b.assignAtomTypes()
    toGeo(b, b.name + '.geo')
    toXyz(b, b.name + '.xyz')
Example #14
0
from block import dumpBlock
from dump import Dump
from output_conf import toXyz, toPdb, toPoscar, toReaxLammps

lmpfile = "dump.lammpstrj"
sepfile = "dump.sep"
dt = 1

# parse the dump file with multi configurations into seperated dump files
nframe = dumpBlock(lmpfile, sepfile, dt)
nframe += 1

for i in range(0, nframe, dt):
    #for i in range(10):
    a = Dump("%s%05d.dump" % (sepfile, i))
    b = a.parser()
    b.assignAtomTypes()
    b.assignEleTypes()
    b.toFrac()

    toXyz(b, "xyz%05d.xyz" % i)
    #b.sortXYZ("z")
    toPdb(b, "pdb%05d.pdb" % i)
    toReaxLammps(b, "lammps.data")
    toPoscar(b, )
Example #15
0
""" parse the geo file with multi configuration into
seperated files
"""
import os
from utilities import parseBlock
from mytype import System, Molecule, Atom
from geo import Geo
from output_conf import toGeo
from output_conf import toXyz

os.chdir("/home/tao/Documents/debug/geofile")
parseBlock("geo", 1)
for i in range(204):
    fname = "out%03d"%i 
    a = Geo(fname)
    b = a.parser()
    b.assignAtomTypes()
    toGeo(b, b.name+'.geo')
    toXyz(b, b.name+'.xyz')

Example #16
0
from mytype import System, Molecule, Atom
from poscar import Poscar
from output_conf import toXyz, toGeo, toPdb, toReaxLammps

import sys

if len(sys.argv) > 1:
    fname = sys.argv[1]
else:
    fname = "CONTCAR"
a = Poscar(fname)
b = a.parser()
b.assignAtomTypes()
b.assignEleTypes()
print b.getVol()

toXyz(b)
toGeo(b, "geo")
toPdb(b, "sim.pdb")
toReaxLammps(b, "lammps.data")

Example #17
0
""" read the geo file and output to data (LAMMPS), geo and xyz file.
"""
from mytype import System, Molecule, Atom
from geo import Geo
from output_conf import toData
from output_conf import toGeo
from output_conf import toXyz

testfile = "../../debug/geo"
a = Geo(testfile)
b = a.parser()
b.assignAtomTypes()
toData(b)
toGeo(b)
toXyz(b)
Example #18
0
""" read the geo file and output to data (LAMMPS), geo and xyz file.
"""
import sys, os
from mytype import System, Molecule, Atom
from g03 import G03Gjf
from output_conf import toXyz, toGeo, toGjf

usage = """gau2xyz g03logfiles"""
if len(sys.argv) < 2:
    print usage
else:
    for i in sys.argv[1:]:
        outfile = i.split(".")[0]
        if os.path.exists(i):
            a = G03Gjf(i)
            b = a.parser()
            b.geotag = "BIOGRF 200"
            toXyz(b, outfile + ".xyz")
            toGeo(b, outfile + ".geo")
            toGjf(b, outfile + ".gjf.bak")
        else:
            print "missing file %s" % i
Example #19
0
from block import dumpBlock
from dump import Dump
from output_conf import toXyz, toPdb

lmpfile = "dump.lammpstrj"
sepfile = "dump.sep"
dt = 1


# parse the dump file with multi configurations into seperated dump files
nframe = dumpBlock(lmpfile, sepfile, dt)
nframe += 1

for i in range(0, nframe, dt):
#for i in range(10):
    a = Dump("%s%05d.dump"%(sepfile,i))
    b = a.parser()
    toXyz(b, "xyz%05d.xyz"%i)
    #b.sortXYZ("z")
    toPdb(b, "pdb%05d.pdb"%i)




Example #20
0
""" read the geo file and output to data (LAMMPS), geo and xyz file.
"""
import sys, os
from mytype import System, Molecule, Atom
from g03 import G03Gjf
from output_conf import toXyz, toGeo, toGjf

usage = """gau2xyz g03logfiles"""
if len(sys.argv) < 2:
    print usage
else:
    for i in sys.argv[1:]:
        outfile = i.split(".")[0]
        if os.path.exists(i):
            a = G03Gjf(i)
            b = a.parser()
            b.geotag = "BIOGRF 200"
            toXyz(b, outfile+".xyz")
            toGeo(b, outfile+".geo")
            toGjf(b, outfile+".gjf.bak")
        else:
            print "missing file %s"%i