├── LICENSE ├── README.md ├── make-resp.sh └── make_esp.sh /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 alexa_mist 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Scripts for calculating RESP charges with Gaussian, starting only with `.xyz` file of your compound. 2 | 3 | Generate `.mol2`, `.frcmod` and `.pdb` with calculated RESP charges, for Molecular Dynamic simulations in Amber. 4 | 5 | ## make_esp.sh 6 | First, use `make_esp.sh` for run an optimization of your compound (in your desired level of theory) and a single point for ESP calculation, with HF/6-31G* (protocol for RESP charges, read more in https://pubs.acs.org/doi/abs/10.1021/j100142a004). 7 | For neutral molecules in a singlet state, otherwise, change input generation section of make_esp.sh! 8 | 9 | **files needed:** compound.xyz 10 | 11 | **packages needed:** Gaussian; marathon (https://github.com/dudektria/marathon) - for using Gaussian (or change the line where marathon is called, for the method you submit jobs in Gaussian) 12 | 13 | **usage:** `./make_esp.sh` `xyz(without .xyz)` `opt_level(scape special characters, for gaussian input)` `nprocs-opt` `nprocs-esp` 14 | 15 | **ex:** `./make_esp.sh` `compound` `MP2/6-311G\*` `8` `2` 16 | 17 | or 18 | 19 | `nohup` `./make_esp.sh` `compound` `MP2/6-311G\*` `8` `2` `&` (still running, even if you exit terminal, in background) 20 | 21 | Press enter each gaussian run finishes. 22 | 23 | ## make-resp.sh 24 | Before, use `make_resp.sh` for generating compound.mol2, compound.frcmod and compound.pdb with calculated RESP charges. 25 | 26 | **files needed:** compound_esp.out (output from ESP calculation) 27 | 28 | **packages needed:** antechamber; parmchk 29 | 30 | **usage:** `./make_resp.sh` `esp_output(without _esp.out)` `residue_name` 31 | 32 | **ex:** `./make_resp.sh` `compound` `RES` 33 | -------------------------------------------------------------------------------- /make-resp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #whats necessary? out from gaussian 4 | 5 | #usage ./make-resp.sh gout (s/ _esp.out) ndx 6 | 7 | #variables 8 | gout="$1" 9 | ndx="$2" 10 | 11 | enter="If this step is ok, press [Enter] key to continue..." 12 | end="If it's all ok, press [Enter] to finish. Good Job!" 13 | 14 | #Colors 15 | RED='\033[0;31m' 16 | NC='\033[0m' 17 | BLUE='\033[0;34m' 18 | GREEN='\033[0;32m' 19 | MAG='\033[0;95m' 20 | 21 | #pause 22 | function pause(){ 23 | read -p "$*" 24 | } 25 | 26 | 27 | ### 28 | 29 | #antechamber----------------------------------------------------------------- 30 | echo -e "${RED}ANTECHAMBER${NC}" 31 | 32 | antechamber -i ${gout}_esp.out -fi gout -o ${gout}.mol2 -fo mol2 -c resp -eq 2 -s 2 -pf y -rn ${ndx} 33 | 34 | pause $(echo -e ${BLUE}$enter${NC}) 35 | 36 | rm esout 37 | rm punch 38 | rm qout 39 | rm QOUT 40 | 41 | parmchk -i ${gout}.mol2 -f mol2 -o ${gout}.frcmod 42 | 43 | antechamber -i ${gout}.mol2 -fi mol2 -o ${gout}.pdb -fo pdb -rn ${ndx} 44 | 45 | #sed -i '/CONECT/d' ${gout}.pdb 46 | 47 | pause $(echo -e ${GREEN}$end${NC}) 48 | -------------------------------------------------------------------------------- /make_esp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #written by Alechania Misturini - 2018 3 | 4 | #whats necessary? .xyz 5 | # marathon 6 | 7 | # usage: ./make-esp.sh xyz(without .xyz) optlevel(scape special characters) nprocs-opt nprocs-esp 8 | # ex: ./make-esp.sh compound MP2/6-311G\* 8 2 9 | # or 10 | # ex: nohup ./make-esp.sh compound MP2/6-311G\* 8 2 & 11 | # (still running, even if you exit terminal, in background) 12 | 13 | #for neutral molecules in a singlet state! 14 | #kill tail with ctrl+D 15 | 16 | #variables 17 | xyz="$1" 18 | optlevel="$2" 19 | nproc1="$3" 20 | nproc2="$4" 21 | 22 | enter="If this step is ok, press [Enter] key to continue..." 23 | end="If it's all ok, press [Enter] to finish. Good Job!" 24 | 25 | #Colors 26 | RED='\033[0;31m' 27 | NC='\033[0m' 28 | BLUE='\033[0;34m' 29 | GREEN='\033[0;32m' 30 | MAG='\033[0;95m' 31 | 32 | #pause 33 | function pause(){ 34 | read -p "$*" 35 | } 36 | 37 | ### 38 | 39 | #generate gjf opt----------------------------------------------------------------- 40 | echo -e "${RED}GENERATE GJF FILE OPT ${optlevel} ${NC}" 41 | 42 | echo -e "%nproc=${nproc1} 43 | %chk=${xyz}_opt 44 | #P ${optlevel} Opt 45 | 46 | ${xyz} opt 47 | 48 | 0 1 49 | 50 | " > ${xyz}_opt.gjf 51 | 52 | tail -n+3 ${xyz}.xyz > xyzcut 53 | 54 | sed -i '7 r xyzcut' ${xyz}_opt.gjf 55 | 56 | cat ${xyz}_opt.gjf 57 | 58 | rm -f xyzcut 59 | 60 | pause $(echo -e ${BLUE}$enter${NC}) 61 | 62 | #run opt----------------------------------------------------------------- 63 | 64 | echo -e "${MAG}RUN OPT WITH GAUSSIAN09: kill tail with ctrl+D ${NC}" 65 | 66 | marathon g09 ${xyz}_opt.gjf & 67 | 68 | pause $(echo -e ${BLUE}$enter${NC}) 69 | 70 | tail -f ${xyz}_opt.out & #put & to execute on backgroud 71 | read -sn 1 #wait for user input 72 | kill %1 #kill the first background progress 73 | 74 | pause $(echo -e ${BLUE}$enter${NC}) 75 | 76 | cp ${xyz}_opt.chk ./${xyz}_esp.chk 77 | 78 | #generate gjf esp ----------------------------------------------------------------- 79 | echo -e "${RED}GENERATE GJF FILE OPT B3LYP/6-31G*${NC}" 80 | 81 | echo -e "%nproc=${nproc2} 82 | %mem=256MB 83 | %chk=${xyz}_esp 84 | #P HF/6-31G* Geom=check SCF=Tight Pop=MK IOp(6/33=2,6/41=10,6/42=17) 85 | 86 | ${xyz} esp HF 87 | 88 | 0 1 89 | 90 | 91 | " > ${xyz}_esp.gjf 92 | 93 | cat ${xyz}_esp.gjf 94 | 95 | pause $(echo -e ${BLUE}$enter${NC}) 96 | 97 | #run single-point----------------------------------------------------------------- 98 | echo -e "${MAG}RUN ESP WITH GAUSSIAN09: kill tail with ctrl+D ${NC}" 99 | 100 | marathon g09 ${xyz}_esp.gjf & 101 | 102 | pause $(echo -e ${BLUE}$enter${NC}) 103 | 104 | tail -f ${xyz}_esp.out & #put & to execute on backgroud 105 | read -sn 1 #wait for user input 106 | kill %1 #kill the first background progress 107 | 108 | pause $(echo -e ${GREEN}$end${NC}) 109 | --------------------------------------------------------------------------------