PLAMS
=====
Python Library for Automating Molecular Simulation
------------------------------------------------------
PLAMS is a collection of tools that aims to provide powerful, flexible and easily extendable Python interface to molecular modeling programs. It takes care of input preparation, job execution, file management and output processing as well as helps with building more advanced data workflows.
Usually the daily work of a computational chemist consists of running a number of calculations. Those calculations are done using one or more molecular modeling programs like ADF, BAND, Turbomole or Dirac (we will call such programs *external binaries*). Obtaining results with one of such programs requires a series of steps. First, the subject of the problem (description of a molecular system, set of desired simulation parameters) has to be presented in the format understandable by molecular modeling program and written to an *input file* which is usually a text file. Then the program is executed, it runs and produces *output* which is a collection of text or binary files. That output usually contains more information than is required for a particular problem so data of interest has to be extracted and (possibly) postprocessed. That different computational tools use different input and output formats and are executed differently. In most cases many *single calculations* need to be performed to solve the problem of interest. That requires significant effort to be put into data hygiene to avoid confusing or overwriting input and output files from distinct calculations.
Each of the above steps, apart from actual calculation done by a molecular modeling program, needs to be performed by a human. Preparing and editing text files, creating folders in the filesystem, copying files between them and reading data from output are tedious, repetitive and highly error-prone work. Some users deal with it using automation, usually in form of ad hoc shell scripts. A few programs, like the Amsterdam Modeling Suite, offer graphical user interface to help with this kind of work, but again, input preparation and output examination, even though assisted with convenient tools, have to be done by a human. Quite often it turns out to be a performance bottleneck to create big automatic computational workflows, where output data of one calculation is used (usually after some processing) as an input to another calculation, sometimes done with different program on a different machine.
PLAMS was created to solve these problems. It takes responsibility of tiresome and monotonous technical details allowing you to focus on real science and your problem. It lets you do all the things mentioned above (and many more) using simple Python scripts. It gives you a helping hand with automating repetitive or complicated tasks while still leaving you with 100% control over what is really happening with your files, disks and CPUs.
What can be done with PLAMS
----------------------------
The key design principle of PLAMS is *flexibility*. If something (by something we mean: adjusting an input parameter, executing binary with particular options, extracting a value from output etc.) can be done by hand, it can be done with PLAMS. The internal structure of the library was designed in highly modular, object-oriented manner. Thanks to that it takes very little effort to adjust its behavior to one's personal needs or to extend its functionality.
Most important features of PLAMS:
* preparing, running and examining results of molecular modeling job from within a single Python script
* convenient automatic file and folder management
* running jobs in parallel without a need to prepare a special script
* integration with popular job schedulers (OGE, SLURM, TORQUE)
* reading and writing molecular coordinates using various formats (`xyz`, `mol`, `mol2`, `pdb`)
* prevention of multiple runs of the same job
* easy data transfer between separate runs
* efficient restarting in case of crash
* full coverage of all input options and output data for programs of the Amsterdam Modeling Suite (ADF, BAND, DFTB, MOPAC, ReaxFF, ...)
* support for Dirac, Orca, Gamess and CP2K (more coming soon)
* easy extendable for other programs, job schedulers, file formats etc.
Simple example
----------------------------
To provide some real life example, here is a simple PLAMS script performing the following work-flow:
- generate xyz geometries from SMILES strings
- optimize the structures using the fast semi-empirical method GFN1-xTB
- compute the bonding energy for the optimized structures using the DFT engine ADF
```python
# A dictionary with molecule names and smiles strings:
mol_smiles = {'Methane' : 'C',
'Ethane' : 'C-C',
'Ethylene' : 'C=C',
'Acetylene': 'C#C'}
# Settings for the semi-empirical GFN1-xTB geometry optimization:
go_xtb_settings = Settings()
go_xtb_settings.input.ams.Task = 'GeometryOptimization'
go_xtb_settings.input.dftb.Model = 'GFN1-xTB'
# Settings for the single point DFT calculation with ADF:
sp_adf_settings = Settings()
sp_adf_settings.input.ams.Task = 'SinglePoint'
sp_adf_settings.input.adf.basis.type = 'DZP'
sp_adf_settings.input.adf.XC.GGA = 'PBE'
for name, smiles in mol_smiles.items():
# Generate an xyz structure from the smiles string:
mol = from_smiles(smiles)
# Run the geometry optimization with GFN1-xTB:
go_job = AMSJob(molecule=mol, settings=go_xtb_settings, name=f'go_{name}')
go_job.run()
optimized_mol = go_job.results.get_main_molecule()
# Run the single point energy calcualtion with DFT (ADF:
sp_job = AMSJob(molecule=optimized_mol, settings=sp_adf_settings, name=f'sp_{name}')
sp_job.run()
bonding_energy = sp_job.results.get_energy(unit='kcal/mol')
# Print the results:
print(f"Energy for {name}: {bonding_energy} [kcal/mol]")
```
When executed, the above script creates uniquely named working folder, then runs a series of calculations, each in a separate subfolder of the working folder. All files created by each run are saved in the corresponding subfolder for future reference.
Further reading
--------------------
You can find full [PLAMS documentation](https://www.scm.com/doc/plams/index.html) hosted on our website, together with some [tutorials](https://www.scm.com/doc/Tutorials/Scripting/Scripting.html).
You can also build your local copy of the documentation by cloning this repository and executing `doc/build_plams_doc` script.
没有合适的资源?快使用搜索试试~ 我知道了~
用于自动化分子模拟的Python库___下载.zip
共381个文件
py:145个
rst:92个
png:74个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 26 浏览量
2023-04-16
20:25:20
上传
评论
收藏 3.26MB ZIP 举报
温馨提示
用于自动化分子模拟的Python库___下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
用于自动化分子模拟的Python库___下载.zip (381个子文件)
build_plams_doc 2KB
batio3.cif 820B
boxes.css 491B
.gitignore 816B
layout.html 228B
favicon.ico 5KB
PackMol.rst.include 19KB
conformers.rst.include 12KB
diels_alder_addition.rst.include 11KB
ams_plumed.rst.include 8KB
water_optimization.rst.include 8KB
MoleculeSubstitution.rst.include 8KB
property_prediction.rst.include 5KB
BandStructureExample.rst.include 4KB
AMSCalculatorWorkerMode.rst.include 3KB
xrd.rst.include 2KB
PackMol.ipynb 529KB
conformers.ipynb 315KB
BandStructureExample.ipynb 169KB
MoleculeSubstitution.ipynb 159KB
diels_alder_addition.ipynb 117KB
ams_plumed.ipynb 111KB
xrd.ipynb 78KB
property_prediction.ipynb 55KB
ChargedAMSCalculator.ipynb 45KB
water_optimization.ipynb 27KB
AMSCalculatorWorkerMode.ipynb 13KB
copybutton.js 2KB
README.md 6KB
CONTRIBUTING.md 2KB
LICENSE.md 640B
RedoxPotential.rst.old 6KB
OxidationPotential.out 249B
plams 4KB
plams_defaults 4KB
molecule_analysis.png 61KB
conformers_16_1.png 54KB
conformers_26_1.png 53KB
conformers_20_1.png 53KB
conformers_23_1.png 52KB
pesplot.png 51KB
xrd_7_0.png 49KB
BandStructureExample_9_0.png 46KB
BandStructureExample_15_0.png 44KB
sigma_profile.png 41KB
MoleculeSubstitution_20_0.png 40KB
bond_analysis.png 40KB
plams_density_along_z.png 37KB
MoleculeSubstitution_14_0.png 35KB
PackMol_25_1.png 34KB
PackMol_20_1.png 34KB
BandStructureExample_6_0.png 34KB
PackMol_19_1.png 34KB
PackMol_16_1.png 34KB
PackMol_21_1.png 33KB
plams_green_kubo_viscosity.png 32KB
PackMol_24_1.png 32KB
PackMol_27_1.png 30KB
plams_power_spectrum.png 29KB
plams_vacf.png 29KB
plams_logo.png 29KB
BandStructureExample_11_0.png 28KB
wrap2.png 28KB
vaporpressures.png 27KB
PackMol_6_1.png 26KB
PackMol_8_1.png 25KB
PackMol_9_1.png 24KB
ams_plumed_11_0.png 23KB
plams_vacf_D.png 22KB
property_prediction_7_0.png 19KB
PackMol_7_1.png 19KB
PackMol_10_2.png 17KB
set_tree.png 17KB
wrap.png 17KB
ams_plumed_14_0.png 17KB
PackMol_10_1.png 15KB
property_prediction_13_0.png 13KB
ChargedAMSCalculator.include_11_0.png 13KB
ChargedAMSCalculator.include_3_0.png 13KB
ams_plumed_13_0.png 13KB
diels_alder_addition_12_0.png 11KB
diels_alder_addition_14_0.png 10KB
diels_alder_addition_21_0.png 10KB
conformers_3_0.png 10KB
diels_alder_addition_18_0.png 10KB
diels_alder_addition_19_0.png 9KB
diels_alder_addition_20_0.png 9KB
diels_alder_addition_7_0.png 9KB
ams_plumed_16_0.png 8KB
PackMol_23_0.png 8KB
MoleculeSubstitution_5_0.png 8KB
ams_plumed_18_0.png 7KB
BandStructureExample_8_0.png 7KB
diels_alder_addition_9_0.png 6KB
ams_plumed_11_4.png 6KB
ams_plumed_11_3.png 6KB
xrd_3_0.png 6KB
ams_plumed_11_1.png 6KB
ams_plumed_11_2.png 6KB
AMSCalculatorWorkerMode_3_0.png 5KB
共 381 条
- 1
- 2
- 3
- 4
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功