MOF Assembly (mofa.assembly)#

Functions needed to go from molecule produced from the generator to a new MOF

MOF Assembly (m.assembly.assemble)#

Functions for assembling a MOF structure

mofa.assembly.assemble.assemble_COO_pcuMOF(nodePath, linkerPaths, newMOFpath, dummyElement='At')#

assembly code for -COO only MOF with pcu topology

Parameters:
  • nodePath – node xyz file path,

  • linkerPaths – node xyz file paths,

  • newMOFpath – assembled MOF file path,

  • dummyElement – dummy element for anchoring positions

Returns:

returnValue a cif file path if assembly succeeded, None if failed

mofa.assembly.assemble.assemble_many(ligand_options: dict[str, list[LigandDescription]], nodes: list[NodeDescription], to_make: int, attempts: int) list[MOFRecord]#

Make many MOFs

Parameters:
  • ligand_options – Many choices for each type of ligand

  • nodes – List of nodes used for assembly

  • to_make – Target number to make

  • attempts – Number of times to attempt per MOF before giving up

Returns:

Up to the target number of MOFs

mofa.assembly.assemble.assemble_mof(nodes: Sequence[NodeDescription], ligands: dict[str, Sequence[LigandDescription]], topology: str) MOFRecord#

Generate a new MOF from the description of the nodes, ligands and topology

Parameters:
  • nodes – Descriptions of each node

  • ligands – A map of anchor type to chosen ligands for a certain MOF

  • topology – Name of the topology

Returns:

A new MOF record assembled from the node description and ligands updated to reflect the XYZ used in the structure

mofa.assembly.assemble.assemble_pillaredPaddleWheel_pcuMOF(nodePath, COOLinkerPaths, PillarLinkerPath, dummyElementCOO='At', dummyElementPillar='Fr') str#

assembly code for -COO and -N ligands MOF with pcu topology

Parameters:
  • nodePath – node xyz file path

  • COOLinkerPaths – Paths of two -COO node xyz

  • PillarLinkerPath – Paths of a single -N node xyz

  • dummyElementCOO – dummy element for -COO anchoring positions,

  • dummyElementPillar – dummy element for -N anchoring positions

Returns:

A CIF-format version of the structure

mofa.assembly.assemble.pandas2xyzfile(df, fpath, useStringIO=False)#

write a Pandas with [element, x, y, z] to a xyz file

Parameters:
  • df – Pandas with [element, x, y, z]

  • fpath – xyz file path

  • useStringIO – whether to write Pandas content into a string

Returns:

string of xyz file if useStringIO enabled, or empty string if useStringIO disabled

mofa.assembly.assemble.readCOOLinkerXYZ(fpath, dummyElement='At')#

Read xyz file of a -COO type connect-2 ligand

Parameters:
  • fpath – xyz file path

  • dummyElement – dummy element for anchoring the -C(=O)O group

Returns:

Pandas of node element, x, y, z, and anchor ID pairs

mofa.assembly.assemble.readNbasedLinkerXYZ(fpath, dummyElement='Fr')#

Read xyz file of a -N type connect-2 ligand

Parameters:
  • fpath – xyz file path

  • dummyElement – dummy element for anchoring the -N group

Returns:

Pandas of node element, x, y, z, and anchor ID pairs

mofa.assembly.assemble.readPillaredPaddleWheelXYZ(fpath, dummyElementCOO='At', dummyElementPillar='Fr')#

Read xyz file of a paddlewheel node

Parameters:
  • fpath – xyz file path

  • dummyElementCOO – dummy element for anchoring the -C(=O)O group

  • dummyElementPillar – dummy element for anchoring the aromatic N group

Returns:

Pandas of node [element, x, y, z], -COO anchor ID pairs in the opposite directions, -N anchor ID pairs in the opposite directions

mofa.assembly.assemble.readTetramerXYZ(fpath, dummyElement='At')#

Read xyz file of a tetramer node

Parameters:
  • fpath – xyz file path

  • dummyElementCOO – dummy element for anchoring the -C(=O)O group

Returns:

Pandas of node element, x, y, z, and anchor ID pairs

mofa.assembly.assemble.rotmat2align(vec1, vec2)#

return a rotation matrix that rotates a 3D vector to align with another 3D vector

Parameters:
  • vec1 – input vector 1

  • vec2 – input vector 2

Returns:

3x3 rotation matrix