Skip to main content

Sponge Extension For Enhanced Sampling

Project description

SpongeExt

为MindSponge和CudaSPONGE设计的接口函数。CudaSPONGE部分通过SpongeExt,可以外接如PySAGES等基于Python的增强采样软件。MindSponge部分通过SpongeExt,可以扩展PyTorch后端,在GPU环境运行。

安装教程

从源码安装:

$ git clone https://gitee.com/dechin/sponge-ext.git && cd sponge-ext && python3 setup.py install --user

从pip安装:

$ python3 -m pip install SpongeExt --upgrade -i https://pypi.org/simple

CudaSPONGE使用案例

准备一系列的CudaSPONGE输入文件,例如examples中的nvt.in配置输入文件:

case1 MD simulation

mode = NVT
default_in_file_prefix = ../protein/alad

pbc=0 
cutoff=999

dt = 1e-3
step_limit = 2000
write_information_interval = 10

thermostat = middle_langevin
middle_langevin_gamma = 10

rst = nvt_restart

coordinate_in_file = ../protein/alad_coordinate.txt
plugin = /usr/local/python-3.7.5/lib/python3.7/site-packages/prips/_prips.so
py = ../pysages_metad.py

这里使用到了一个使用pysages定义的增强采样方法pysages_metad.py,内容为:

from SpongeExt import enhanced_sponge

import pysages
from pysages.colvars import DihedralAngle
from pysages.methods import Metadynamics

def phi_psi():
    from numpy import pi
    cvs = [DihedralAngle([4, 6, 8, 14]), DihedralAngle([6, 8, 14, 16])]
    height = 5.0  # kJ/mol
    sigma = [0.4, 0.4]  # radians
    stride = 3
    ngauss = 500
    grid = pysages.Grid(lower=(-pi, -pi), upper=(pi, pi), shape=(50, 50), periodic=True)
    method = Metadynamics(cvs, height, sigma, stride, ngauss, grid=grid)
    return method

pysages_method = phi_psi()
Calculate_Force, Mdout_Print = enhanced_sponge(pysages_method)

然后使用运行指令运行即可:

$ SPONGE -mdin nvt.in

输出内容大致如下图所示:

------------------------------------------------------------------------------------------------------------
           step =            1990,            time =           1.990,     temperature =         2388.79, 
      potential =           56.45,            CV_0 =       -1.500586,            CV_1 =       -2.550561, 
             LJ =           -0.79,         Coulomb =          -65.33,         nb14_LJ =            7.42, 
        nb14_EE =           41.19,            bond =            6.05,           angle =           40.54, 
       dihedral =           27.37, 
------------------------------------------------------------------------------------------------------------
           step =            2000,            time =           2.000,     temperature =         2430.97, 
      potential =           60.92,            CV_0 =       -0.989361,            CV_1 =       -3.084765, 
             LJ =           -0.22,         Coulomb =          -66.38,         nb14_LJ =            4.81, 
        nb14_EE =           42.10,            bond =            9.91,           angle =           38.81, 
       dihedral =           31.90, 
------------------------------------------------------------------------------------------------------------

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spongeext-1.1.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SpongeExt-1.1-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file spongeext-1.1.tar.gz.

File metadata

  • Download URL: spongeext-1.1.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.5

File hashes

Hashes for spongeext-1.1.tar.gz
Algorithm Hash digest
SHA256 cbbd66ce39bd42fdc5ad9547ebba9d6633c8bbd493c0692e4a548f4af167ca6a
MD5 6bc385a6d26d5390f7caf7a39b619d80
BLAKE2b-256 61c54ccf77ebe1014abd3823b513d7cd9e431ef16a437de4c74dc6bd2d01a9c3

See more details on using hashes here.

File details

Details for the file SpongeExt-1.1-py3-none-any.whl.

File metadata

  • Download URL: SpongeExt-1.1-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.5

File hashes

Hashes for SpongeExt-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8bbd082aee5f190b0fa6a8074b88462d52a60cc16ba0b3abc703ed73db5f3674
MD5 661a44fc7dcc951b6bac995edb4d8ffb
BLAKE2b-256 378bbdb85e96f7b949f107d552170575df2e103c38461c2d9e49d697a6b7381e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page