请先下载Desmond 的安装包,上传到google drive 里面,然后点击分享链接,替换下面的wget,注意Desmond 对商业用户为付费软件,学术用户请先通过D E Shaw 公司的审核后才可使用

下载安装包到colab

In [ ]:
from google.colab import drive
drive.mount('/content/drive')
Mounted at /content/drive
In [ ]:
! cp /content/drive/MyDrive/Desmond_Maestro_2021.1.tar /content/
In [ ]:
! tar -xvf Desmond_Maestro_2021.1.tar
Desmond_Maestro_2021.1/
Desmond_Maestro_2021.1/Desmond_License.txt
Desmond_Maestro_2021.1/CHECKSUM.md5
Desmond_Maestro_2021.1/mmshare-v5.3-Linux-x86_64.tar.gz
Desmond_Maestro_2021.1/academic_license.lic
Desmond_Maestro_2021.1/README.FIRST.txt
Desmond_Maestro_2021.1/Desmond_Maestro_2021.1.tar
Desmond_Maestro_2021.1/desmond-v6.5-Linux-x86_64.tar.gz
Desmond_Maestro_2021.1/INSTALL
Desmond_Maestro_2021.1/alldocs-v5.3-docs.tar.gz
Desmond_Maestro_2021.1/maestro-v12.7-Linux-x86_64.tar.gz
In [ ]:
%cd Desmond_Maestro_2021.1/
/content/Desmond_Maestro_2021.1
In [ ]:
!ls
academic_license.lic	    desmond-v6.5-Linux-x86_64.tar.gz
alldocs-v5.3-docs.tar.gz    INSTALL
CHECKSUM.md5		    maestro-v12.7-Linux-x86_64.tar.gz
Desmond_License.txt	    mmshare-v5.3-Linux-x86_64.tar.gz
Desmond_Maestro_2021.1.tar  README.FIRST.txt

创建安装路径,你也可以定义其他路径,但最好是作为guest 也有权写入的路径,以避免后面可能的因管理员权限不够无法安装问题

In [ ]:
%cd /opt
/opt

创建Desmond 工作的临时文件夹,你也可以定义在其他路径

In [ ]:
! mkdir scratch
In [ ]:
!ls
bin  google  nvidia  scratch

开始安装,注意需要手动确认一些路径,记得点击Enter

In [ ]:
%cd /content/Desmond_Maestro_2021.1
/content/Desmond_Maestro_2021.1
In [ ]:
! ./INSTALL
In [ ]:
%env SCHRODINGER /opt/schrodinger2021-1/
env: SCHRODINGER=/opt/schrodinger2021-1/

如果是简单模拟,从charmm gui 下载输入文件,如果是要做FEP,需要用maestro 做蛋白准备后,将小分子配体在2018-4maestro 中按照 flexbile alignment, maxmium substrutures, fuzzy style, 然后上传到Katana的2019-3 版本的maestro 中调用ligand FEP 然后使用write,写出模拟指令sh 文件,然后到这里来运行

In [ ]:
%cd /content/
/content
In [ ]:
%cd /drive/MyDrive
[Errno 2] No such file or directory: '/drive/MyDrive'
/content
In [ ]:
!tar -xvf temple_uni_ligand_fep_2.tgz
ligand_fep_2/
ligand_fep_2/ligand_fep_2_solvent.msj
ligand_fep_2/ligand_fep_2.msj
ligand_fep_2/ligand_fep_2_complex.msj
ligand_fep_2/ligand_fep_2.sh
ligand_fep_2/ligand_fep_2.mae
In [ ]:
%cd /content/ligand_fep_2/
/content/ligand_fep_2
In [ ]:
!ls
 1.prj.zip		  drive			     ligand_fep_2.msj
 2021-07-20		  fep.tgz		     ligand_fep_2.sh
'3htb (1).pdb'		  ligand_fep_2_complex.msj   ligand_fep_2_solvent.msj
 Desmond_Maestro_2021.1   ligand_fep_2.mae	     sample_data
In [ ]:
%cd desmond/
In [ ]:
!ls
README		 step4.0_minimization.cfg   step5_production.cfg
step3_input.cms  step4.1_equilibration.cfg

在开始模拟之前, 必须要先修复一个bug, 链接见https://stackoverflow.com/questions/67419615/could-not-get-username-from-env

In [ ]:
!printenv

接下来,我们将通过环境变量调用Desmond 开始动力学模拟


In [ ]:
%env HOME /root
env: HOME=/root
In [ ]:
%env USER root
env: USER=root
In [ ]:
!nvidia-smi
In [ ]:
!lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              2
On-line CPU(s) list: 0,1
Thread(s) per core:  2
Core(s) per socket:  1
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               63
Model name:          Intel(R) Xeon(R) CPU @ 2.30GHz
Stepping:            0
CPU MHz:             2299.998
BogoMIPS:            4599.99
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            46080K
NUMA node0 CPU(s):   0,1
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm invpcid_single ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt arat md_clear arch_capabilities

需要正确设置schrodinger.hosts 文件

In [ ]:
%cd /opt/schrodinger2021-1/   
/opt/schrodinger2021-1

返回工作文件夹开始模拟,该文件夹,如果是由charmm gui 返回的结果,则为名为desmond的文件夹,如果是相对自由能计算,则应该为有Academic 版本的maestro 写下的ligand_fep_1文件夹,其中应该有三个msj 文件,一个sh 文件,一个mae 文件,最好也要把当时的相关1.prj 文件放到该工作文件夹得外面,pdb蛋白液最好放在外侧。

In [ ]:
%cd /content/fep
/content/fep

经过粘贴复制,或者压缩解压缩后,sh 文件得权限被改变,如果无法运行,需要手动再添加一次 +x flag, 以允许其可以被运行

In [ ]:
!chmod +x ligand_fep_2.sh
In [ ]:
!./ligand_fep_2.sh
WARNING: You did not specify for '-maxjob'. Remember its default value is 1.
WARNING: Launching jobs as root is strongly discouraged. Proceeding anyway...
JobId: 4e57950a11ca-0-60f67854

任务开始后,注意监测log 文件即可,如果是fep计算,即使使用Tesla V100 32GB 也需要五小时左右,因谷歌平台得GPU一般是K80, 因此模拟任务不一定可以在10小时内完成。 如果是简单的模拟任务,应该可以胜任。

基于colab 得模拟应当作为百度AI studio 平台得补充,因为谷歌平台所提供的显卡能力弱于百度,且无法免费使用命令终端,速度和效率都比百度底。

一个可行的弥补办法,是将complex 分支和solvent 分支分开同是在两个具有GPU算力的平台进行计算,这样整体的计算时间有希望减半。