跳转到主要内容

architector Python包 - 用于3D无机金属配合物设计。

项目描述

Architector

Architector是一个3D化学结构生成软件包,旨在从配体和金属中心的最小2D信息生成具有化学合理性的3D构象和立体化学的有机金属化合物。它能够进行s、p、d和f区有机金属配合物的高通量虚拟构建。Architector代表了金属配合物化学跨周期表计算设计的变革性步骤。

如果您使用此包进行工作,请引用该手稿和代码

  1. 手稿:Taylor, M.G., Burrill, D.J., Janssen, J., Batsita, E.R., Perez, D. 和 Yang. P. Architector for high-throughput cross-periodic table 3D complex building. Nat Commun 14, 2786 (2023). https://doi.org/10.1038/s41467-023-38169-2

  2. 代码: https://www.github.com/lanl/Architector

安装

建议使用Conda安装。可以通过以下方式安装conda-forge发行版

conda install -c conda-forge architector
  • 如果需要开发版本的软件,请在Architector根目录下运行
conda env create -f environment.yml
conda activate architector
pip install -e .

有用的工具/示例

  1. 请参阅教程以了解基本功能和代码示例: documentation/tutorials/
  2. 核心和配体几何标签的参考请参阅:documentation/view_default_core_ligand_types.ipynb
  3. 辅助确定配体配位位点的实用程序,请参阅:utils/ligand_viewing_coordinating_atom_selecting.ipynb
  4. 没有生成结构时调试案例的参考,请参阅:documentation/Debugging_Guide.ipynb
  • 请注意,在(3)中使用的配体甚至可以在Avogadro以及大多数其他2D分子编辑器(例如ChemDraw)中绘制,并将作为SMILES字符串复制到此分析中。
  • 如果使用其他分析来确定配位原子索引,我们无法保证生成的结构将与输入匹配。如果生成带有新配体的复合物,我们强烈建议使用(3)中的实用程序。

XTB(后端)可能有用的参考资料

复杂结构功能的基本使用

from architector import build_complex
out = build_complex(inputDict)

输入字典结构和建议

inputDict = {
################ Core (metal) structure and optional definitions #####################
# Requires input for what metal and what type of coordination environments to sample #

"core": {
    "metal":'Fe', 
    # "coordList" OR "coreType" OR "coreCN" (Suggested!)
    'coordList': None, 
    # Handles user-defined list of core coordination vectors e.g.
    # [
    #     [2., 0.0, 0.0],
    #     [0.0, 2., 0.0],
    #     [0.0, 0.0, 2.],
    #     [-2., 0.0, 0.0],
    #     [0.0, -2., 0.0],
    #     [0.0, 0.0, -2.] 
    # ] -> gets defined as 'user_geometry'
    "coreType": None, 
    # e.g. 'octahedral' ....
    # or list of coreTypes - e.g. ['octahedral','trigonal_prismatic','tetrahedral']
    "coreCN": 6 #(SUGGETED!)
    # Core coordination number (CN) (int)
    # Will calculate all possible geometries with the given coreCN 
    # Tends to sample the metal space better than other options.
    # OR list of CNs [4,6] -> Will calculate all possible geometries with these CNs.
    # NOTE that if nothing is passed, a list of common coreCNs will be used to attempt structure generation.
    }, 
############## Ligands  list and optional definitions ####################
# Requires either smiles and metal-coordinating site definitions or default ligand names  #

"ligands": [
    {"smiles":"n1ccccc1-c2ccccn2",
    # Smiles required. Can also be generated and drawn using avogadro molecular editor.
    "coordList":[0, 11], 
    # Coordination sites corresponding to the SMILES atom connecting to the metal
    # Can be determined/assigned manually using utils/ligand_viewing_coordinating_atom_selecting.ipynb
    # Alternatively [[0,1],[11,2]], In this case it forces it to be map to the user-defined core coordinating sites.
    'ligType':'bi_cis'
    # Optional, but desirable - if not-specified will will assign the best ligType guess using a brute force assignment that can be slow. 
    }, 
    ],
    # NOTE - multiple ligands should be added to fill out structure if desired.

############## Additional Parameters for the structural generation  ####################
# Here, metal oxdiation state and spin state, methods for evaluating complexes during construction, #
# And many other options are defined, but are often handled automatically by Architector in the background #

"parameters" = {
    ######## Electronic parameters #########
    "metal_ox": None, # Oxidation State
    "metal_spin": None, # Spin State
    "full_spin": None, # Assign spin to the full complex (overrides metal_spin)
    "full_charge": None, # Assign charge to the complex (overrides ligand charges and metal_ox)!
        
    # Method parameters.
    "full_method": "GFN2-xTB", # Which  method to use for final cleaning/evaulating conformers. 
    "assemble_method": "GFN2-xTB", # Which method to use for assembling conformers. 
    # For very large speedup - use "GFN-FF", though this is much less stable (especially for Lanthanides)
    # Additionaly, it is possible to use "UFF" - which is extremely fast. Though it is recommend to perform an XTB-level optimization
    # for the "full_method", or turn "relaxation" off.
    "xtb_solvent": 'none', # Add any named XTB solvent!
    "xtb_accuracy": 1.0, # Numerical Accuracy for XTB calculations
    "xtb_electronic_temperature": 300, # In K -> fermi smearing - increase for convergence on harder systems
    "xtb_max_iterations": 250, # Max iterations for xtb SCF.
    "force_generation":False, # Whether to force the construction to proceed without xtb energies - defaults to UFF evaluation
    # in cases of XTB outright failure. Will still enforce sanity checks on output structures.
    "ff_preopt":False, # Whether to force forcefield (FF) pre-optimization of fully-built complexes before final xtb evalulation.
    # FF preoptimization helps especially in cases where longer carbon chains are present that tend to overlap.
    # This option will also decrease the maximum force tolerance for xtb relaxation to 0.2 and set assemble_method='GFN-FF'
    # By default for acceleration.


    # Covalent radii and vdw radii of the metal if nonstandard radii requested.
    "vdwrad_metal": vdwrad_metal,
    "covrad_metal": covrad_metal,

    ####### Conformer parameters and information stored ########
    "n_conformers": 1, # Number of metal-core symmetries at each core to save / relax
    "return_only_1": False, # Only return single relaxed conformer (do not test multiple conformations)
    "n_symmetries": 10, # Total metal-center symmetrys to build, NSymmetries should be >= n_conformers
    "relax": True, # Perform final geomtetry relaxation of assembled complexes
    "save_init_geos": False, # Save initial geometries before relaxations.
    "crest_sampling": False, # Perform CREST sampling on lowest-energy conformer(s)?
    "crest_sampling_n_conformers": 1, # Number of lowest-energy Architector conformers on which to perform crest sampling.
    "crest_options": "--gfn2//gfnff --noreftopo --nocross --quick", # Crest Additional commandline options 
    # Note that Charge/Spin/Solvent should NOT be added to crest_options 
    # they will be used from the generated complexes and xtb_solvent flags above.
    "return_timings": True, # Return all intermediate and final timings.
    "skip_duplicate_tests": False, # Skip the duplicate tests (return all generated/relaxed configurations)
    "return_full_complex_class": False, # Return the complex class containing all ligand geometry and core information.
    "uid": u_id, # Unique ID (generated by default, but can be assigned)
    "seed": None, # If a seed is passed (int/float) use it to initialize np.random.seed for reproducability.
    # If you want to replicate whole workflows - set np.random.seed() at the beginning of your workflow.
    # Right not openbabel will still introduce randomness into generations - so it is often valuable
    # To run multiple searches if something is failing.

    # Dump all possible intermediate xtb calculations to separate ASE database
    "dump_ase_atoms": False, # or True
    "ase_atoms_db_name": 'architector_ase_db_{uid}.json', # Possible to name the databse filename
    # Will default to a "uid" included name.
    "temp_prefix":"/tmp/", # Default here - for MPI running on HPC suggested /scratch/$USER/

    ####### Ligand parameters #########
    # Ligand to finish filling out coordination environment if underspecified.
    "fill_ligand": "water", 
    # Secondary fill ligand will be a monodentate ligand to fill out coordination environment
    # in case the fill_ligand and specified ligands list cannot fully map to the coordination environment.
    "secondary_fill_ligand": "water",
    # or integer index in reference to the ligand list!!
    "force_trans_oxos":False, # Force trans configurations for oxos (Useful for actinyls)
    "lig_assignment":'bruteforce', # or "similarity" - How to automatically assign ligand types.

    ######### Sanity check parameters ########
    "assemble_sanity_checks":True, # Turn on/off assembly sanity checks.
    "assemble_graph_sanity_cutoff":1.8, 
    # Graph Sanity cutoff for imposed molecular graph represents the maximum elongation of bonds
    # rcov1*full_graph_sanity_cutoff is the maximum value for the bond lengths.
    "assemble_smallest_dist_cutoff":0.3,
    # Smallest dist cutoff screens if any bonds are less than smallest_dist_cutoff*sum of cov radii
    # Will not be evaluated by XTB if they are lower.
    "assemble_min_dist_cutoff":4,
    # Smallest min dist cutoff screens if any atoms are at minimum min_dist_cutoff*sum of cov radii
    # away from ANY other atom (indicating blown-up structure) 
    # - will not be evaluated by XTB if they are lower.
    "full_sanity_checks":True, # Turn on/off final sanity checks.
    "full_graph_sanity_cutoff":1.7,
    # full_graph_sanity_cutoff can be tightened to weed out distorted geometries (e.g. 1.5 for non-group1-metals) 
    "full_smallest_dist_cutoff":0.55,
    "full_min_dist_cutoff":3.5,
    } 
}

输出字典结构和建议

out = {
    'core_geometry_i_nunpairedes_X_charge_Y': 
    # Key labels indicates metal center geometry, total unpaired electrons (X, spin), 
    # and charge (Y) of the complex
    {'ase_atoms':ase.atoms.Atoms, # Structure (with attached used ASE calculator!) for the output complex.
    'total_charge': int, # Suggested total charge if another method used.
    'calc_n_unpaired_electrons': int, # Suggested unpaired electrons if another method used.
    'xtb_total_charge':int, # Same as (Y) (different from total_charge for non-oxidation state=3 f-block elements!)
    'xtb_n_unpaired_electrons' : int, # Same as (X) Unpaired electrons used for xTB (different for f-block elements!) 
    'metal_ox': int, # Metal oxidation state assigned to the complex
    'init_energy': float, # Initial (unrelaxed) xTB energy (eV)
    'energy': float, # Relaxed xTB energy (eV)
    'mol2string': str, # Final relaxed structure in TRIPOS mol2 format.
    'init_mol2string': str, # Initial unrelaxed structure in TRIPOS mol2 format.
    'energy_sorted_index': int, # Index of the complex from pseudo-energy ranking,
    'inputDict': dict, # Full input dictionary copy (including assigned parameters) for replication!
    ..... Timing information ....},
    ** More structures **
}
  • 请注意,输出字典是根据能量排序的OrderDict(第一条记录的能量最低。)

在Jupyter笔记本框架内,直接从字典中可视化所有生成的结构相当容易。

from architector import view_structures

view_structures(out)

以下示例行可以轻松导出为xyz,供任何其他电子结构代码使用。

out['core_geometry_i_nunpairedes_X_charge_Y']['ase_atoms'].write('core_geometry_i_nunpairedes_X_charge_Y.xyz')

或者,Architector中包含一个文件格式转换器,可以读取格式化的mol2文件类型,这对于维护定义的分子图和键级非常有用。

from architector import convert_io_molecule

mol = convert_io_molecule(out['core_geometry_i_nunpairedes_X_charge_Y']['mol2string'])
print(mol.uhf) # n_unpaired electrons for electronic structure evaluation
print(mol.charge) # total charge
mol.write_xyz('core_geometry_i_nunpairedes_X_charge_Y.xyz')

在Architector分子Python对象(mol,如上所述)中还包括分子图(mol.graph)、SYBYL类型键级(mol.BO_dict)、xTB未成对电子(mol.xtb_uhf)以及完整的ASE Atoms对象(mol.ase_atoms),其中包含从输出mol2string分配的电荷(mol.charge)和磁矩(mol.uhf)。

作者

  • Michael G. Taylor
  • Daniel J. Burrill
  • Jan Janssen
  • Danny Perez
  • Enrique R. Batista
  • Ping Yang

许可和版权

有关许可信息,请参阅LICENSE.txt。Architector许可协议为BSD-3。Architector的Los Alamos国家实验室C编号为C22085。

© 2022. Triad National Security, LLC。保留所有权利。本程序是根据美国政府和兰利国家实验室(LANL)的合同89233218CNA000001生产的,由Triad National Security, LLC代表美国能源部/国家核安全管理局运营。保留本程序的所有权利由Triad National Security, LLC和美国能源部/国家核安全管理局所有。政府(及其代表)获得在此材料中非独家、付费、不可撤销的全球许可,以复制、准备衍生作品、向公众分发副本、公开表演和展示,并允许他人这样做。

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分布

architector-0.0.10.tar.gz (6.6 MB 查看哈希值)

上传时间:

构建分布

architector-0.0.10-py3-none-any.whl (6.8 MB 查看哈希值)

上传于 Python 3

由以下支持