added non-slurm calculations

main
Aditya Wibawa Sakti 2 years ago
parent 64a32ccbc6
commit 500f7c3fd1
  1. BIN
      .DS_Store
  2. 89
      bin/cmmde.py
  3. BIN
      lib/__pycache__/cmmde_dcdftb.cpython-39.pyc
  4. BIN
      lib/__pycache__/cmmde_dftb.cpython-39.pyc
  5. BIN
      lib/__pycache__/cmmde_dock.cpython-39.pyc
  6. BIN
      lib/__pycache__/cmmde_hubbard.cpython-39.pyc
  7. BIN
      lib/__pycache__/cmmde_mass.cpython-39.pyc
  8. BIN
      lib/__pycache__/cmmde_mdpro.cpython-39.pyc
  9. BIN
      lib/__pycache__/cmmde_nw.cpython-39.pyc
  10. BIN
      lib/__pycache__/cmmde_orca.cpython-39.pyc
  11. BIN
      lib/__pycache__/cmmde_qe.cpython-39.pyc
  12. BIN
      lib/__pycache__/cmmde_xtb.cpython-39.pyc
  13. 1
      lib/cmmde_hubbard.py
  14. 12
      lib/cmmde_xtb.py

BIN
.DS_Store vendored

Binary file not shown.

@ -28,7 +28,7 @@ parser.add_argument('-m','--method',type=str,default='XTB2',help='Metode yang di
parser.add_argument('-sfreq','--scalefreq',type=float,default=1, help='Faktor skala frekuensi yang digunakan.') parser.add_argument('-sfreq','--scalefreq',type=float,default=1, help='Faktor skala frekuensi yang digunakan.')
# Input yang berkaitan dengan perhitungan menggunakan software DCDFTBMD # Input yang berkaitan dengan perhitungan menggunakan software DCDFTBMD
parser.add_argument('-disp','--dispersion',type=str,default='None', help='Model koreksi dispersi jika menggunakan software DCDFTB. Pilihan: None, D3, D3BJ, D3H5.') parser.add_argument('-disp','--dispersion',type=str,default='None', help='Model koreksi dispersi jika menggunakan software DCDFTB. Pilihan: None, D3, D3BJ, D3H5.')
parser.add_argument('-para','--parapath',type=str,default='/home/adit/opt/dftbplus/external/slakos/origin/3ob-3-1',help='Lokasi folder berisikan himpunan parameter DFTB yang akan digunakan.') parser.add_argument('-para','--parapath',type=str,default='/Users/adit/opt/dftbplus/external/slakos/origin/3ob-3-1',help='Lokasi folder berisikan himpunan parameter DFTB yang akan digunakan.')
parser.add_argument('-iter','--iter',type=int,default=9999, help='Jumlah iterasi dalam optimasi geometri dan jenis perhitungan lainnya') parser.add_argument('-iter','--iter',type=int,default=9999, help='Jumlah iterasi dalam optimasi geometri dan jenis perhitungan lainnya')
parser.add_argument('-ens','--ensembel',type=str,default='NVE', help='Ensembel yang digunakan dalam simulasi dinamika molekul. Pilihan: NVE, NVT, dan NPT.') parser.add_argument('-ens','--ensembel',type=str,default='NVE', help='Ensembel yang digunakan dalam simulasi dinamika molekul. Pilihan: NVE, NVT, dan NPT.')
parser.add_argument('-tstat','--thermostat',type=str,default='andersen', help='Termostat yang digunakan dalam simulasi NVT. Pilihan: andersen,berendsen,dan nose') parser.add_argument('-tstat','--thermostat',type=str,default='andersen', help='Termostat yang digunakan dalam simulasi NVT. Pilihan: andersen,berendsen,dan nose')
@ -180,6 +180,7 @@ parser.add_argument('-cpress','--cellpress',type=float,default=0.0,help='Tekanan
parser.add_argument('-press_conv','--press_conv_thr',type=float,default=0.5,help='Kriteria konvergensi untuk tekanan sel. Default=0.5 kbar.') parser.add_argument('-press_conv','--press_conv_thr',type=float,default=0.5,help='Kriteria konvergensi untuk tekanan sel. Default=0.5 kbar.')
parser.add_argument('-nband','--nband',type=int,default=8,help='Jumlah tingkat energi yang ingin diplot dalam DOS.') parser.add_argument('-nband','--nband',type=int,default=8,help='Jumlah tingkat energi yang ingin diplot dalam DOS.')
parser.add_argument('-occ','--occ',type=str,default='tetrahedra',help='Metode smearing yang digunakan. Default: tetrahedra. Pilihan: smearing, tetrahedra_lin, tetrahedra_opt, fixed, from_input.') parser.add_argument('-occ','--occ',type=str,default='tetrahedra',help='Metode smearing yang digunakan. Default: tetrahedra. Pilihan: smearing, tetrahedra_lin, tetrahedra_opt, fixed, from_input.')
parser.add_argument("-slurm","--slurm",type=str,default="true",help="Apakah akan menggunakan slurm atau tidak. Default: true")
opt=parser.parse_args(sys.argv[1:]) opt=parser.parse_args(sys.argv[1:])
@ -187,6 +188,7 @@ opt=parser.parse_args(sys.argv[1:])
if ('.xyz' or '.pdb' or 'POSCAR' or '.vasp' or '.poscar') in opt.input: if ('.xyz' or '.pdb' or 'POSCAR' or '.vasp' or '.poscar') in opt.input:
geom = opt.input geom = opt.input
elif '.mol2' in opt.input: elif '.mol2' in opt.input:
if opt.slurm == "true":
with open('run_babel.sh','w') as fout: with open('run_babel.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
@ -197,9 +199,18 @@ export OMP_NUM_THREADS={}
cd $PWD cd $PWD
obabel {} -O geom.xyz""".format(opt.nproc,opt.input),file=fout) obabel {} -O geom.xyz""".format(opt.nproc,opt.input),file=fout)
os.system('sbatch run_babel.sh') os.system('sbatch run_babel.sh')
else:
with open('run_babel.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
obabel {} -O geom.xyz""".format(opt.nproc,opt.input),file=fout)
os.system("chmod +x run_babel.sh")
os.system('./run_babel.sh')
geom = 'geom.xyz' geom = 'geom.xyz'
elif ('.mol2' not in opt.input and '.xyz' not in opt.input and '.pdb' not in opt.input and '.vasp' not in opt.input and '.poscar' not in opt.input and 'POSCAR' not in opt.input and '.gen' not in opt.input): elif ('.mol2' not in opt.input and '.xyz' not in opt.input and '.pdb' not in opt.input and '.vasp' not in opt.input and '.poscar' not in opt.input and 'POSCAR' not in opt.input and '.gen' not in opt.input):
os.system("echo '{}' > geom.smi".format(opt.input)) os.system("echo '{}' > geom.smi".format(opt.input))
if opt.slurm == "true":
with open('run_babel.sh','w') as fout: with open('run_babel.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
@ -210,6 +221,14 @@ export OMP_NUM_THREADS={}
cd $PWD cd $PWD
obabel geom.smi -O geom.xyz --gen3d""".format(opt.nproc),file=fout) obabel geom.smi -O geom.xyz --gen3d""".format(opt.nproc),file=fout)
os.system('sbatch run_babel.sh') os.system('sbatch run_babel.sh')
else:
with open('run_babel.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
obabel geom.smi -O geom.xyz --gen3d""".format(opt.nproc),file=fout)
os.system("chmod +x run_babel.sh")
os.system('./run_babel.sh')
while not os.path.exists('geom.xyz'): while not os.path.exists('geom.xyz'):
time.sleep(3) time.sleep(3)
geom = 'geom.xyz' geom = 'geom.xyz'
@ -236,6 +255,7 @@ if opt.software == 'dock':
addcharge(opt.input,opt.chargetype) addcharge(opt.input,opt.chargetype)
if opt.job == 'sphgen': if opt.job == 'sphgen':
sphgen(opt.input) sphgen(opt.input)
if opt.slurm == 'true':
with open('run_sphgen.sh','w') as fout: with open('run_sphgen.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
@ -247,11 +267,20 @@ cd $PWD
$DOCK_DIR/sphgen $DOCK_DIR/sphgen
$DOCK_DIR/sphere_selector protein.sph {} {}""".format(opt.nproc,opt.ligand,opt.dockrange),file=fout) $DOCK_DIR/sphere_selector protein.sph {} {}""".format(opt.nproc,opt.ligand,opt.dockrange),file=fout)
os.system("sbatch run_sphgen.sh") os.system("sbatch run_sphgen.sh")
else:
with open('run_sphgen.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
$DOCK_DIR/sphgen
$DOCK_DIR/sphere_selector protein.sph {} {}""".format(opt.nproc,opt.ligand,opt.dockrange),file=fout)
os.system("chmod +x run_sphgen.sh")
os.system("./run_sphgen.sh")
if opt.job == 'showsphere': if opt.job == 'showsphere':
showsphere() showsphere()
if opt.job == 'gridgen': if opt.job == 'gridgen':
gridgen(opt.input) gridgen(opt.input)
if opt.slurm == "true":
with open('run_grid.sh','w') as fout: with open('run_grid.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
@ -262,9 +291,18 @@ export OMP_NUM_THREADS={}
cd $PWD cd $PWD
$DOCK_DIR/grid -i grid.in""".format(opt.nproc),file=fout) $DOCK_DIR/grid -i grid.in""".format(opt.nproc),file=fout)
os.system("sbatch run_grid.sh") os.system("sbatch run_grid.sh")
else:
with open('run_grid.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
$DOCK_DIR/grid -i grid.in""".format(opt.nproc),file=fout)
os.system("chmod +x run_grid.sh")
os.system("./run_grid.sh")
if opt.job == 'rigiddock': if opt.job == 'rigiddock':
rigiddock(opt.ligand,opt.calcrmsd) rigiddock(opt.ligand,opt.calcrmsd)
if opt.slurm == "true":
with open('run_rigiddock.sh','w') as fout: with open('run_rigiddock.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
@ -275,8 +313,17 @@ export OMP_NUM_THREADS={}
cd $PWD cd $PWD
$DOCK_DIR/dock6 -i rigid.in -o rigid.out""".format(opt.nproc),file=fout) $DOCK_DIR/dock6 -i rigid.in -o rigid.out""".format(opt.nproc),file=fout)
os.system("sbatch run_rigiddock.sh") os.system("sbatch run_rigiddock.sh")
else:
with open('run_rigiddock.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
$DOCK_DIR/dock6 -i rigid.in -o rigid.out""".format(opt.nproc),file=fout)
os.system("chmod +x run_rigiddock.sh")
os.system("./run_rigiddock.sh")
if opt.job == 'flexdock': if opt.job == 'flexdock':
flexdock(opt.ligand,opt.calcrmsd) flexdock(opt.ligand,opt.calcrmsd)
if opt.slurm == "true":
with open('run_flexdock.sh','w') as fout: with open('run_flexdock.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
@ -287,6 +334,14 @@ export OMP_NUM_THREADS={}
cd $PWD cd $PWD
$DOCK_DIR/dock6 -i flex.in -o flex.out""".format(opt.nproc),file=fout) $DOCK_DIR/dock6 -i flex.in -o flex.out""".format(opt.nproc),file=fout)
os.system("sbatch run_flexdock.sh") os.system("sbatch run_flexdock.sh")
else:
with open('run_flexdock.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
$DOCK_DIR/dock6 -i flex.in -o flex.out""".format(opt.nproc),file=fout)
os.system("chmod +x run_flexdock.sh")
os.system("./run_flexdock.sh")
if opt.job == 'translig': if opt.job == 'translig':
translig(opt.ligand) translig(opt.ligand)
@ -312,6 +367,7 @@ if opt.software == 'dftb':
geom = 'in.gen' geom = 'in.gen'
dftb(geom,opt.job,opt.activeatoms,opt.method,opt.parapath,opt.dispersion,opt.kpts,opt.hcorr) dftb(geom,opt.job,opt.activeatoms,opt.method,opt.parapath,opt.dispersion,opt.kpts,opt.hcorr)
if opt.slurm == "true":
with open('run.sh','w') as fout: with open('run.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
@ -323,6 +379,15 @@ cd $PWD
cp cmmd.in dftb_in.hsd cp cmmd.in dftb_in.hsd
$DFTB_COMMAND cmmd.in > cmmd.out""".format(opt.nproc),file=fout) $DFTB_COMMAND cmmd.in > cmmd.out""".format(opt.nproc),file=fout)
os.system('sbatch run.sh') os.system('sbatch run.sh')
else:
with open('run.sh','w') as fout:
print("""#!/bin/bash
export OMP_NUM_THREADS={}
cd $PWD
cp cmmd.in dftb_in.hsd
$DFTB_COMMAND cmmd.in > cmmd.out""".format(opt.nproc),file=fout)
os.system("chmod +x run.sh")
os.system('./run.sh')
if opt.software == 'qe': if opt.software == 'qe':
@ -330,6 +395,7 @@ if opt.software == 'qe':
# RUNNING SCRIPT # RUNNING SCRIPT
if opt.software == 'orca': if opt.software == 'orca':
if opt.slurm=="true":
with open('run.sh','w') as fout: with open('run.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
@ -342,8 +408,15 @@ export OMP_NUM_THREADS=1
cd $PWD cd $PWD
$ORCA_COMMAND cmmd.in > cmmd.out --oversubscribe""".format(opt.nproc),file=fout) $ORCA_COMMAND cmmd.in > cmmd.out --oversubscribe""".format(opt.nproc),file=fout)
os.system('sbatch run.sh') os.system('sbatch run.sh')
else:
with open('run.sh','w') as fout:
print("""#!/bin/bash
cd $PWD
$ORCA_COMMAND cmmd.in > cmmd.out --oversubscribe""",file=fout)
os.system("chmod +x run.sh")
os.system('./run.sh')
if opt.software == 'nwchem': if opt.software == 'nwchem':
if opt.slurm=="true":
with open('run.sh','w') as fout: with open('run.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
@ -356,7 +429,13 @@ export OMP_NUM_THREADS=1
cd $PWD cd $PWD
$NWCHEM_COMMAND cmmd.in > cmmd.out""".format(opt.nproc),file=fout) $NWCHEM_COMMAND cmmd.in > cmmd.out""".format(opt.nproc),file=fout)
os.system('sbatch run.sh') os.system('sbatch run.sh')
else:
with open('run.sh','w') as fout:
print("""#!/bin/bash
cd $PWD
$NWCHEM_COMMAND cmmd.in > cmmd.out""",file=fout)
os.system("chmod +x run.sh")
os.system('./run.sh')
if opt.software == 'qe': if opt.software == 'qe':
with open('run.sh','w') as fout: with open('run.sh','w') as fout:
print("""#!/bin/bash print("""#!/bin/bash
@ -403,4 +482,4 @@ if opt.job == 'ligprep' and opt.software == 'gmx':
# Program XTB Standalone # Program XTB Standalone
if opt.software == 'xtb': if opt.software == 'xtb':
xtb(opt.job,geom,opt.nproc,opt.produk,opt.temp,opt.nrun,opt.npoint,opt.anopt,opt.kpush,opt.kpull,opt.ppull,opt.alp,opt.distance,opt.angle,opt.dihedral,opt.scanmode,opt.iter,opt.scan,opt.solvent,opt.charge,opt.mult,opt.method,opt.fixedatoms,opt.fixedelements) xtb(opt.job,geom,opt.nproc,opt.produk,opt.temp,opt.nrun,opt.npoint,opt.anopt,opt.kpush,opt.kpull,opt.ppull,opt.alp,opt.distance,opt.angle,opt.dihedral,opt.scanmode,opt.iter,opt.scan,opt.solvent,opt.charge,opt.mult,opt.method,opt.fixedatoms,opt.fixedelements,opt.slurm)

@ -2,6 +2,7 @@ def azimuth(element):
# Pemetaan bilangan kuantum azimut maksimum untuk masing-masing unsur # Pemetaan bilangan kuantum azimut maksimum untuk masing-masing unsur
azimuth = { azimuth = {
'Cl' : '3', 'Cl' : '3',
'Al' : '3',
'H': '1', 'H': '1',
'Cu': '3', 'Cu': '3',
'O' : '2', 'O' : '2',

@ -1,7 +1,8 @@
# CMMDE function for xTB standalone program # CMMDE function for xTB standalone program
import os import os
def xtb(job,geom,nproc,product,temperature,nrun,npoint,anopt,kpush,kpull,ppull,alp,distance,angle,dihedral,scanmode,maxiter,scan,solvent,charge,mult,method,fixedatoms,fixedelements): def xtb(job,geom,nproc,product,temperature,nrun,npoint,anopt,kpush,kpull,ppull,alp,distance,angle,dihedral,scanmode,maxiter,scan,solvent,charge,mult,method,fixedatoms,fixedelements,slurm):
with open('run.sh','w') as fout: with open('run.sh','w') as fout:
if slurm == "true":
print("""#!/bin/bash print("""#!/bin/bash
#SBATCH --nodes=1 #SBATCH --nodes=1
#SBATCH --ntasks=1 #SBATCH --ntasks=1
@ -9,6 +10,9 @@ def xtb(job,geom,nproc,product,temperature,nrun,npoint,anopt,kpush,kpull,ppull,a
#SBATCH --time=168:0:0 #SBATCH --time=168:0:0
export OMP_NUM_THREADS={} export OMP_NUM_THREADS={}
cd $PWD""".format(nproc), file=fout) cd $PWD""".format(nproc), file=fout)
else:
print("""#!/bin/bash
export OMP_NUM_THREADS={}""".format(nproc),file=fout)
meth = '' meth = ''
if 'GFN-FF' in method or 'gfnff' in method: if 'GFN-FF' in method or 'gfnff' in method:
meth += '--gfnff' meth += '--gfnff'
@ -108,8 +112,12 @@ $end""".format(nrun,npoint,anopt,kpush,kpull,ppull,alp),file=f)
print("""$opt print("""$opt
maxcycle = {}""".format(maxiter),file=f) maxcycle = {}""".format(maxiter),file=f)
if slurm == "true":
os.system('sbatch run.sh') os.system('sbatch run.sh')
else:
os.system('chmod +x run.sh')
os.system('./run.sh')

Loading…
Cancel
Save