Skip to content

Commit

Permalink
Merge branch 'master' of github.com:UAMCAntwerpen/2040FBDBIC
Browse files Browse the repository at this point in the history
Resolve issues
  • Loading branch information
UAMCAntwerpen committed Oct 25, 2023
2 parents b2ef792 + 27b5879 commit 3365e49
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions Topic_04/Protein_ligand_MD.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "8x9Qp_dbr9HP"
},
"outputs": [],
Expand Down Expand Up @@ -943,9 +942,6 @@
"execution_count": null,
"metadata": {
"cellView": "form",
"colab": {
"background_save": true
},
"id": "dkZnDwundH78"
},
"outputs": [],
Expand Down Expand Up @@ -1315,28 +1311,28 @@
"\n",
"#@title MM-PBSA method to calculate the binding free energy\n",
"#@markdown **Important:** We will now calculate the interaction energy and solvation free energy for the complex, receptor and ligand and average the results to obtain an estimate of the binding free energy. Please note that we will not perform a calculation of the entropy contribution to binding and so strictly speaking our result will not be a true free energy but could be used to compare against similar systems. We will carry out the binding energy calculation using both the MM-GBSA method and the MM-PBSA method for comparison.\n",
"igb = \"2\" \n",
"mbondi = 'mbondi2'\n",
"\n",
"Salt_concentration = '0.15'\n",
"fold_MMPBSA = \"MMPBSA_igb_\" + igb \n",
"fold_MMPBSA = \"MMPBSA_igb_2\"\n",
"Output_name = 'FINAL_RESULTS_MMPBSA'\n",
"\n",
"final_mmpbsa = os.path.join(workDir, Output_name)\n",
"\n",
"#@markdown Interval (number of frames to skip): \n",
"Interval = \"5\" #@param [\"1\", \"2\", \"5\", \"10\"]\n",
"inter = int(Interval)\n",
"\n",
"#@markdown Start frame: \n",
"Start_frame = \"50\" #@param {type:\"string\"}\n",
"start = int(Start_frame)\n",
"\n",
"f = open(\"mmpbsa.in\", \"w\")\n",
"f.write(\"&general \\n\")\n",
"#f.write(\" startframe=1,\\n\")\n",
"f.write(\" endframe=%d,\\n\" % (number_frames_analysis))\n",
"f.write(\" interval=1,\\n\")\n",
"f.write(\" verbose=2,\\n\")\n",
"f.write(\" keep_files=2,\\n\")\n",
"f.write(\" interval=%d,\\n\" % (inter))\n",
"f.write(\" startframe=%d,\\n\" % (start))\n",
"f.write(\" strip_mask=:WAT:Na+:Cl-:Mg+:K+,\\n\")\n",
"f.write(\"/\\n\")\n",
"f.write(\"&gb \\n\")\n",
"f.write(\" igb=2,\\n\")\n",
"f.write(\" saltconc=0.15,\\n\")\n",
"f.write(\"/\\n\")\n",
"f.write(\"&pb \\n\")\n",
"f.write(\" istrng=0.15,\\n\")\n",
Expand All @@ -1348,11 +1344,18 @@
"\n",
"amberhome = \"source /usr/local/amber.sh\\n\"\n",
"\n",
"if os.path.exists(\"com.prmtop\"): os.remove(\"com.prmtop\")\n",
"if os.path.exists(\"rec.prmtop\"): os.remove(\"rec.prmtop\")\n",
"if os.path.exists(\"ligand.prmtop\"): os.remove(\"ligand.prmtop\")\n",
"\n",
"ante_MMPBSA = \"ante-MMPBSA.py \\\\\\n\"\n",
"ante_MMPBSA += \" -p \" + os.path.join(workDir, \"complex.prmtop\") + \"\\\\\\n\"\n",
"ante_MMPBSA += \" -c com.prmtop -r rec.prmtop -l ligand.prmtop \\\\\\n\"\n",
"ante_MMPBSA += \" -s :WAT:Na+:Cl-:Mg+:K+ -n :LIG \\\\\\n\"\n",
"ante_MMPBSA += \"--radii \" + str(mbondi) \n",
"ante_MMPBSA += \" -p \" + os.path.join(workDir, \"complex.prmtop\") + \" \\\\\\n\"\n",
"ante_MMPBSA += \" -c com.prmtop \\\\\\n\"\n",
"ante_MMPBSA += \" -r rec.prmtop \\\\\\n\"\n",
"ante_MMPBSA += \" -l ligand.prmtop \\\\\\n\"\n",
"ante_MMPBSA += \" -s :WAT:Na+:Cl-:Mg+:K+ \\\\\\n\"\n",
"ante_MMPBSA += \" -n :LIG \\\\\\n\"\n",
"ante_MMPBSA += \"--radii=mbondi2 \\n\"\n",
"\n",
"MMPBSA = \"MMPBSA.py \\\\\\n\"\n",
"MMPBSA += \" -O \\\\\\n\"\n",
Expand Down Expand Up @@ -1394,7 +1397,6 @@
"f_mmpbsa.close()"
],
"metadata": {
"cellView": "form",
"id": "u3nWM58oT1Ab"
},
"execution_count": null,
Expand All @@ -1403,16 +1405,15 @@
{
"cell_type": "code",
"source": [
"#@title Cleanup all remaining files\n",
"\n",
"os.system(\"rm sqm.*\")\n",
"os.system(\"rm run_MMPBSA.sh\")\n",
"os.system(\"rm leap.log\")\n",
"os.system(\"rm *.pdb*\")\n",
"os.system(\"rm -rf /content/drive/MyDrive/protein_ligand/\")"
"answer = False\n",
"if answer:\n",
" os.system(\"rm sqm.*\")\n",
" os.system(\"rm run_MMPBSA.sh\")\n",
" os.system(\"rm leap.log\")\n",
" os.system(\"rm *.pdb*\")\n",
" os.system(\"rm -rf /content/drive/MyDrive/protein_ligand/\")"
],
"metadata": {
"cellView": "form",
"id": "27Q-zHFTj8b5"
},
"execution_count": null,
Expand Down

0 comments on commit 3365e49

Please sign in to comment.