Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-arantes committed Aug 12, 2021
1 parent 331577f commit 328feb0
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions AlphaFold2+MD.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@
"#@markdown **Attention:** A high number of frames can explode the memory on Colab. You should be fine with 5000 frames or less.\n",
"\n",
"simulation_time_analysis = stride_time_ps*nstride\n",
"simulation_ns = int(Stride_Time)*int(Number_of_strides)\n",
"simulation_ns = float(Stride_Time)*int(Number_of_strides)\n",
"number_frames = int(simulation_time_analysis)/int(Write_the_trajectory)\n",
"number_frames_analysis = number_frames/int(stride_traj)\n",
"\n",
Expand Down Expand Up @@ -1655,6 +1655,7 @@
"\n",
"import warnings\n",
"warnings.filterwarnings('ignore')\n",
"!rm *.pdb 2> /dev/null\n",
"\n",
"#py3dmol functions\n",
"class Atom(dict):\n",
Expand Down Expand Up @@ -1928,10 +1929,10 @@
"last_frame = len(time_array)\n",
"\n",
"stride_ticks_f = (last_frame)/5\n",
"ticks_frame = np.arange(0,(len(time_array) + int(stride_ticks_f)), int(stride_ticks_f))\n",
"ticks_frame = np.arange(0,(len(time_array) + float(stride_ticks_f)), float(stride_ticks_f))\n",
"a = ticks_frame.astype(float)\n",
"stride_ticks_t = (simulation_ns)/5\n",
"tick_time = np.arange(0,(int(simulation_ns) + int(stride_ticks_t)), int(stride_ticks_t))\n",
"tick_time = np.arange(0,(float(simulation_ns) + float(stride_ticks_t)), float(stride_ticks_t))\n",
"b = tick_time.astype(float)\n",
"\n",
"mat1 = pt.pairwise_rmsd(traj_load, mask=\"@CA\", frame_indices=range(int(number_frames_analysis)))\n",
Expand All @@ -1943,8 +1944,8 @@
"plt.ylabel('Time (ns)', fontsize = 14, fontweight = 'bold')\n",
"# plt.xticks(fontsize = 12)\n",
"# plt.yticks(fontsize = 12)\n",
"plt.xticks(a, b, fontsize = 12)\n",
"plt.yticks(a, b, fontsize = 12)\n",
"plt.xticks(a, b.round(decimals=3), fontsize = 12)\n",
"plt.yticks(a, b.round(decimals=3), fontsize = 12)\n",
"# plt.xlim(0, a[-1])\n",
"# plt.ylim(0, a[-1])\n",
"\n",
Expand Down Expand Up @@ -1978,11 +1979,11 @@
"last_frame = len(time_array)\n",
"\n",
"stride_ticks_f = (last_frame)/5\n",
"ticks_frame = np.arange(0,(len(time_array) + int(stride_ticks_f)), int(stride_ticks_f))\n",
"a = ticks_frame.astype(int)\n",
"ticks_frame = np.arange(0,(len(time_array) + float(stride_ticks_f)), float(stride_ticks_f))\n",
"a = ticks_frame.astype(float)\n",
"a2 = a.tolist()\n",
"stride_ticks_t = (simulation_ns)/5\n",
"tick_time = np.arange(0,(int(simulation_ns) + int(stride_ticks_t)), int(stride_ticks_t))\n",
"tick_time = np.arange(0,(float(simulation_ns) + float(stride_ticks_t)), float(stride_ticks_t))\n",
"b = tick_time.astype(float)\n",
"\n",
"#@markdown **Provide output file names below:** \n",
Expand Down Expand Up @@ -2011,7 +2012,7 @@
"cbar1 = plt.colorbar(a, orientation=\"vertical\")\n",
"cbar1.set_label('Time(ns)', fontsize = 14, fontweight = 'bold')\n",
"cbar1.set_ticks(a2)\n",
"cbar1.set_ticklabels(b)\n",
"cbar1.set_ticklabels(b.round(decimals=3))\n",
"\n",
"plt.savefig(os.path.join(workDir, Output_name + \".png\"), dpi=600, bbox_inches='tight')\n",
"\n",
Expand Down

0 comments on commit 328feb0

Please sign in to comment.