Skip to content

Commit

Permalink
example to generate a psf file without charmm
Browse files Browse the repository at this point in the history
  • Loading branch information
florianjoerg committed May 17, 2023
1 parent 07c6caa commit de5a366
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
29 changes: 29 additions & 0 deletions templates/im1h_oac/generate_psf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import sys
#pip install git+https://github.com/florianjoerg/cbchelpers.git
from cbchelpers.parmed_extension import enable_psf_from_scratch
enable_psf_from_scratch()
from parmed.charmm import CharmmParameterSet, CharmmPsfFile

def main():
para_files = [
"../../protex/forcefield/toppar/toppar_drude_master_protein_2013f_lj025.str",
"../../protex/forcefield/toppar/im1h_d.str",
"../../protex/forcefield/toppar/oac_d_dummy.str",
"../../protex/forcefield/toppar/im1_d_dummy.str",
"../../protex/forcefield/toppar/hoac_d.str",
]

molecules = {
"IM1H": {"number": 150, "drude_mass": 0.4},
"OAC": {"number": 150, "drude_mass": 0.4},
"IM1": {"number": 350, "drude_mass": 0.4},
"HOAC": {"number": 350, "drude_mass": 0.4},
}

params = CharmmParameterSet(*para_files)
psf = CharmmPsfFile.from_scratch(params, molecules)
print(len(psf.residues))
psf.write_psf("im1h_oac_150_im1_hoac_350.psf")

if __name__ == "__main__":
main()
12 changes: 12 additions & 0 deletions templates/im1h_oac/initialize_nocharmm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

###change###
filename="im1h_oac_150_im1_hoac_350"
#############

echo "Running packmol..."
packmol <packmol.inp >packmol.out
echo "Running pdb2crd..."
./pdb2crd ${filename}_init.pdb >${filename}.crd
echo "Running Python, create psf"
python generate_psf.py

0 comments on commit de5a366

Please sign in to comment.