Skip to content

Instantly share code, notes, and snippets.

@leelasd
Created August 27, 2018 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leelasd/25644670b77557c42b85fbcee8bf96a6 to your computer and use it in GitHub Desktop.
Save leelasd/25644670b77557c42b85fbcee8bf96a6 to your computer and use it in GitHub Desktop.
Create PSF file and other things using the following script
## vmd -dispdev text -e MetaDynamics_CreatePSF.tcl
mol load pdb protein_clean.pdb
set protein [atomselect top protein]
set chains [lsort -unique [$protein get pfrag]]
foreach chain $chains {
set sel [atomselect top "pfrag $chain"]
$sel writepdb myfile_frag${chain}.pdb
}
### Split the PDB file into segments and then create a over all psf/pdb file
package require psfgen
package require solvate
package require autoionize
topology top_opls_aam.inp
topology LIG.rtf
pdbalias residue HIS HSE
pdbalias residue HID HSD
pdbalias residue HIP HSP
#
segment PROA {
pdb myfile_frag0.pdb
}
coordpdb myfile_frag0.pdb PROA
#MAKE SURE YOU GIVE PDB FILE YOU USE HERE IS THE PDB FILE
segment LIGA {
first none
last none
pdb LIG_final.pdb
}
coordpdb LIG_final.pdb LIGA
#
guesscoord
writepsf complex.psf
writepdb complex.pdb
solvate complex.psf complex.pdb -t 12 -o complex_wb
autoionize -psf complex_wb.psf -pdb complex_wb.pdb -neutralize -o ionized
mol load pdb ionized.pdb
[atomselect top "backbone"] set beta 1
[atomselect top "all"] writepdb fixed.pdb
put "Printing Calpha atoms that are \nwithin 5 Angstroms of ligand"
[atomselect top "(name CA) and (within 5 of segname LIGA)"] get serial
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment