MOF Builder

MOF Builder#

initialize the Mofbuilder and ask the Mofbuilder to show all available MOFs family

import veloxchem as vlx

mof = vlx.MofBuilder()
# next line can be skipped if you know the family name
mof.show_available_mof_families()  
/home/linares/miniconda3/envs/vlx-github/lib/python3.12/site-packages/veloxchem/database
Available MOF Family:
UiO-66 UiO-67 UiO-68 PCN-222 MOF-545 NU-1000 PCN-224 MOF-525 MOF-535 MOF-808 MOF-818 PCN-777 NU-901 MIL-100 PCN-228 PCN-229 PCN-230 MIL-101

To build a target MOF, you need to:

  1. assign MOF family

  2. assign the node metal type

  3. upload the linker file (with carboxylate) in xyz format \

you can also set the supercell size of the model
then we can build the MOF
we can save the model with gromacs file format and show it

mof.mof_family = 'UiO-66'
mof.node_metal = 'Zr'
mof.linker_xyz_file = '../input_files/linker.xyz'
mof.supercell = (1, 1, 1)  # (1,1,1) means primitive cell
mof.build()
mof.show(residue_indices=True, residue_names=False)
UiO-66 selected
available metal nodes: ['Zr', 'Hf']
please select a metal node
will search template cif files in /home/linares/miniconda3/envs/vlx-github/lib/python3.12/site-packages/veloxchem/database/template_database
fcu.cif is found in template_database
fcu.cif will be used for MOF building
Zr node is selected
found the file including ['12c', 'Zr']
File copied from /home/linares/miniconda3/envs/vlx-github/lib/python3.12/site-packages/veloxchem/database/nodes_database/12c_Zr.pdb to nodes/12c_Zr.pdb
nodes/12c_Zr.pdb is fetched
default node without dummy atoms will be usednodes/12c_Zr.pdb
nodes will be saved in nodes
found the file including ['12c', 'Zr']
2 is selected for linker splitting
center is a cycle
center_nodes: [6, 7, 8, 30, 29, 27, 10, 11, 12, 13, 19, 18, 16, 15] center_class: cycle 2
[12, 13]
ditopic linker: center is a cycle
find connected X in edge:   24
find connected X in edge:   39
pairXs: [24, 39]
linker_center_frag: 46 [18, 33]
linker edge fragment edges/diedge.pdb is saved and will be used for MOF building
--------------------------------------------------------------------------------
                     Preparation is completed                     
--------------------------------------------------------------------------------
MOF builder is ready to build
ditopic mof builder driver is called
 no symmetry operation
 no symmetry operation
trying to read pdb file nodes/12c_Zr.pdb
trying to read pdb file edges/diedge.pdb
--------------------------------------------------------------------------------
                     start to optimize the rotations                     
--------------------------------------------------------------------------------
optimize_rotations_step1
optimize_rotations information:
opt_method: L-BFGS-B
--------------------------------------------------------------------------------
                     rotations optimization completed                     
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
                     start to optimize the cell parameters                     
--------------------------------------------------------------------------------
Optimized New Cell Parameters: [39.35195 39.35195 39.35195 90.      90.      90.     ] 
Template Cell Parameters: [14.1421, 14.1421, 14.1421, 90.0, 90.0, 90.0]
--------------------------------------------------------------------------------
                     cell parameters optimization completed                     
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
                Building time cost: 0.56629 seconds 
--------------------------------------------------------------------------------
main fragment of the MOF cell is kept
node_res_num:  14
edge_res_num:  36
term_res_num:  96
node_res_num:  14
edge_res_num:  36
term_res_num:  96

3Dmol.js failed to load for some reason. Please check your browser console for error messages.

we can make defective models by remove linkers or nodes
here we just want to remove the linker in the corner

#the index of the linkers or nodes to be removed can be shown 
# in the last cell output
# remove the linker with index "17, 18, 19"
mof.remove(linkers=[17, 18, 39], update_node_termination=True)  
mof.show(residue_indices=True)
mof.write_gromacs_files()
built MOF is saved
defective MOF is updated
node_res_num:  14
edge_res_num:  33
term_res_num:  102
node_res_num:  14
edge_res_num:  33
term_res_num:  102

3Dmol.js failed to load for some reason. Please check your browser console for error messages.

gro_name is not set, will be saved as:  mof_UiO-66_linker.gro
node_res_num:  14
edge_res_num:  36
term_res_num:  96
writing the gromacs file output_gros/mof_UiO-66_linker.gro
writing the gromacs file output_gros/defective_mof_UiO-66_linker.gro
node_res_num:  14
edge_res_num:  33
term_res_num:  102