Advertisement
ProzacR

mano Acpype4Gromacs

Aug 24th, 2015
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.42 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. #gromacs with acpype
  4.  
  5. #Assuming stanting file is istarting with pdb ID
  6. file=$(file *_fix.pdb | head -c 4)
  7. lig=$(grep "^HETATM" ${file}_fix.pdb | tail -n 1 | awk '{print $4}')
  8.  
  9. # Assuming Complex.pdb (= 1BVG.pdb), split it in Protein.pdb and ${lig}.pdb
  10. # wget -c "http://www.pdb.org/pdb/download/downloadFile.do?fileFormat=pdb&compression=NO&structureId=1BVG" -O 1BVG.pdb
  11. grep 'ATOM  ' ${file}_fix.pdb>| Protein.pdb
  12. #jau yra:
  13. grep 'HETATM' ${file}_fix.pdb>| ${lig}.pdb
  14.  
  15. \cp Protein.pdb ProteinAmber.pdb
  16.  
  17. # Process with pdb2gmx and define water
  18. /scratch/lustre/home/vyra6599/bin/gromacs-4.6.7/build/src/kernel/pdb2gmx_mpi -ff amber99sb -f ProteinAmber.pdb -o Protein2.pdb -p Protein.top -water spce -ignh || exit 1
  19.  
  20. # Generate ${lig} topology file with acpype (GAFF)
  21. #acpype -i ${lig}.pdb
  22.  
  23. # Merge Protein2.pdb + updated ${lig}_NEW.pdb -> Complex.pdb
  24. grep -h ATOM Protein2.pdb ${lig}.acpype/${lig}_NEW.pdb >| Complex.pdb
  25.  
  26. # Edit Protein.top -> Complex.top
  27. \cp ${lig}.acpype/${lig}_GMX.itp ${lig}.itp
  28. \cp Protein.top Complex.top
  29.  
  30. # #include "${lig}.itp" has to be inserted right after ffamber**.itp line and before Protein_*.itp line in Complex.top.
  31.  
  32. cat Complex.top | sed "/forcefield\.itp\"/a\
  33. #include \"${lig}.itp\"
  34. " >| Complex2.top
  35.  
  36. echo "${lig}   1" >> Complex2.top
  37. \mv Complex2.top Complex.top
  38.  
  39. # Setup the box and add water
  40. /scratch/lustre/home/vyra6599/bin/gromacs-4.6.7/build/src/tools/editconf_mpi -bt triclinic -f Complex.pdb -o Complex.pdb -d 1.0 || exit 1
  41. /scratch/lustre/home/vyra6599/bin/gromacs-4.6.7/build/src/tools/genbox_mpi -cp Complex.pdb -cs spc216.gro -o Complex_b4ion.pdb -p Complex.top || exit 1
  42.  
  43. # Create em.mdp file
  44. cat << EOF >| em.mdp
  45. define                   = -DFLEXIBLE
  46. integrator               = cg ; steep
  47. nsteps                   = 200
  48. constraints              = none
  49. emtol                    = 1000.0
  50. nstcgsteep               = 10 ; do a steep every 10 steps of cg
  51. emstep                   = 0.01 ; used with steep
  52. nstcomm                  = 1
  53. coulombtype              = PME
  54. ns_type                  = grid
  55. rlist                    = 1.0
  56. rcoulomb                 = 1.0
  57. rvdw                     = 1.4
  58. Tcoupl                   = no
  59. Pcoupl                   = no
  60. gen_vel                  = no
  61. nstxout                  = 0 ; write coords every # step
  62. optimize_fft             = yes
  63. EOF
  64.  
  65. # Create md.mdp file
  66. cat << EOF >| md.mdp
  67. integrator               = md
  68. nsteps                   = 5000000 ; 10 ns
  69. dt                       = 0.002
  70. constraints              = all-bonds
  71. nstcomm                  = 1
  72. ns_type                  = grid
  73. rlist                    = 1.2
  74. rcoulomb                 = 1.1
  75. rvdw                     = 1.0
  76. vdwtype                  = shift
  77. rvdw-switch              = 0.9
  78. coulombtype              = PME-Switch
  79. Tcoupl                   = v-rescale
  80. tau_t                    = 0.1 0.1
  81. tc-grps                  = protein non-protein
  82. ref_t                    = 300 300
  83. Pcoupl                   = parrinello-rahman
  84. Pcoupltype               = isotropic
  85. tau_p                    = 0.5
  86. compressibility          = 4.5e-5
  87. ref_p                    = 1.0
  88. gen_vel                  = yes
  89. nstxout                  = 2 ; write coords every # step
  90. lincs-iter               = 2
  91. DispCorr                 = EnerPres
  92. optimize_fft             = yes
  93. EOF
  94.  
  95. # Setup ions
  96. /scratch/lustre/home/vyra6599/bin/gromacs-4.6.7/build/src/kernel/grompp_mpi -f em.mdp -c Complex_b4ion.pdb -p Complex.top -o Complex_b4ion.tpr || exit 1
  97. \cp Complex.top Complex_ion.top
  98.  
  99. # neber -norandom tokios tai istrinta
  100. echo 15| /scratch/lustre/home/vyra6599/bin/gromacs-4.6.7/build/src/tools/genion_mpi -s Complex_b4ion.tpr -o Complex_b4em.pdb -neutral -conc 0.15 -p Complex_ion.top || exit 1
  101.  
  102. \mv Complex_ion.top Complex.top
  103.  
  104. /scratch/lustre/home/vyra6599/bin/gromacs-4.6.7/build/src/kernel/grompp_mpi -f em.mdp -c Complex_b4em.pdb -p Complex.top -o em.tpr || exit 1
  105.  
  106. # Create min.job file
  107. cat << EOF >| min.job
  108. #!/bin/tcsh
  109. #SBATCH -p long
  110. #SBATCH -n12
  111. #SBATCH -t 02-00:00
  112. /scratch/lustre/home/vyra6599/bin/gromacs-4.6.7/build/src/kernel/mdrun_mpi -deffnm em
  113. EOF
  114.  
  115.  
  116. # Create sim.job file
  117. cat << EOF >| sim.job
  118. #!/bin/tcsh
  119. #SBATCH -p verylong
  120. #SBATCH -n12
  121. #SBATCH -t 02-00:00
  122. /scratch/lustre/home/vyra6599/bin/gromacs-4.6.7/build/src/kernel/grompp_mpi -f md.mdp -c em.gro -p Complex.top -o md.tpr
  123. /scratch/lustre/home/vyra6599/bin/gromacs-4.6.7/build/src/kernel/mdrun_mpi -deffnm md
  124. EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement