晶体学数据结构
crystals的Python项目详细描述
crystals是一个数据结构和算法库,用于以pythonic方式操作抽象晶体。crystals有助于阅读晶体 文件(如.cif和.pdb)提供了对原子位置、散射实用程序的访问,并允许确定对称性。尽管crystals可以单独使用, 它是为了集成到更大的项目中(比如scikit-ued)。
查看documentation了解更多信息。
用法示例
crystals的全部内容是构造晶体和获取有关生成对象的信息。晶体可以从多种来源制造:
- 从磁盘上的文件,例如晶体学信息文件(CIF);
- 来自90多个结构文件(主要是元素晶体)的内部数据库;
- 来自在线数据库,如RCSB Protein DataBank或 Crystallography Open Database
下面是一个从内部数据库构建水晶的快速示例:
>>> from crystals import Crystal >>> >>> vo2 = Crystal.from_database('vo2-m1') >>> print(vo2) # Short string representation < Crystal object with following unit cell: Atom O @ (0.90, 0.79, 0.80) Atom O @ (0.90, 0.71, 0.30) Atom O @ (0.61, 0.31, 0.71) Atom O @ (0.39, 0.69, 0.29) Atom O @ (0.61, 0.19, 0.21) Atom O @ (0.10, 0.29, 0.70) Atom O @ (0.10, 0.21, 0.20) Atom O @ (0.39, 0.81, 0.79) Atom V @ (0.76, 0.03, 0.97) Atom V @ (0.76, 0.48, 0.47) ... omitting 2 atoms ... Lattice parameters: a=5.743Å, b=4.517Å, c=5.375Å α=90.000°, β=122.600°, γ=90.000° Chemical composition: O: 66.667% V: 33.333% Source: (...omitted...)\crystals\cifs\vo2-m1.cif >
对称性信息也很容易获得:
>>> print(vo2.symmetry()) {'international_symbol': 'P2_1/c', 'hall_symbol': '-P 2ybc', 'hm_symbol': 'P121/c1', 'international_number': 14, 'hall_number': 81, 'international_full': 'P 1 2_1/c 1', 'pointgroup': 'C2h'}
安装
crystals在python包索引中可用:
pip install crystals
对于conda包管理器的用户,crystals也可以从conda forge频道获得:
conda install -c conda-forge crystals
来源
crystals也可以从源安装:
git clone https://github.com/LaurentRDC/crystals.git cd crystals python setup.py install
也可以使用pip安装最新的开发版本:
python -m pip install git+git://github.com/LaurentRDC/crystals.git
要构建文档,您还需要一些dev-requirements.txt中列出的包。例如,要从源代码构建文档:
git clone https://github.com/LaurentRDC/crystals.git cd crystals pip install -r dev-requirements.txt python setup.py build_sphinx
文件
文档,包括用户指南和详细参考,可以在这里获得:https://crystals.readthedocs.io/
开发
可以使用标准库的unittest模块运行测试:
python -m unittest discover
如果未安装依赖项,则可能会跳过某些可选测试,例如ase。
引文
由于此包是从scikit-ued派生出来的,如果发现crystals有用,请考虑引用以下出版物:
[1] | L. P. René de Cotret, M. R. Otto, M. J. Stern. and B. J. Siwick, An open-source software ecosystem for the interactive exploration of ultrafast electron scattering data, Advanced Structural and Chemical Imaging 4:11 (2018) DOI: 10.1186/s40679-018-0060-y |
由spglib提供的底层算法在以下出版物中进行了描述:
[2] | A. Togo and I. Tanaka, spglib: a software library for crystal symmetry search. https://arxiv.org/abs/1808.01590 (written at version 1.10.4). |
已针对cif2cell测试了来自cif文件的结构解析的正确性,详情如下:
[3] | Torbjorn Bjorkman, CIF2Cell: Generating geometries for electronic structure programs, Computer Physics Communications 182, 1183-1186 (2011) doi: 10.1016/j.cpc.2011.01.013 |
已针对Bio.PDB测试pdb文件的结构解析是否正确,详细信息如下:
[4] | Hamelryck, T., Manderick, B. PDB parser and structure class implemented in Python. Bioinformatics 19: 2308–2310 (2003) |
原子量报告如下:
[5] | Meija, J., Coplen, T., Berglund, M., et al. (2016). Atomic weights of the elements 2013 (IUPAC Technical Report). Pure and Applied Chemistry, 88(3), pp. 265-291. Retrieved 30 Nov. 2016, doi:10.1515/pac-2015-0305 |
A确认
这个包裹取决于一些了不起的人的工作。值得注意的是spglib contributors。
支持/报告问题
所有支持请求和问题报告都应该是filed on Github as an issue。
许可证
crystals在bsd 3子句许可下可用。有关详细信息,请参见LICENSE。