ABSTRACT (original article): The exhaustive enumeration of 3D chemical structures based on Z-matrix templates has recently been used in the quantum chemical investigation of constitutional isomers, diastereomers and rotamers. This simple yet powerful initial structure generation approach can apply beyond the investigation of compounds of identical formula by quantum chemical methods. This paper provides a comprehensive description of the overall concept followed by a practical tutorial to the approach.
• The four steps required for Z-matrix template-based substitution are template construction, generation of tuples for substitution sites, removal of duplicate tuples and substitution on the template.
• The generated tuples can be used to create chemical identifiers to query compound properties from chemical databases.
• All of these steps are demonstrated in this paper by common model compounds and are very straightforward for an undergraduate audience to reproduce. A comparison of the approach in this paper and other options is also discussed. CITATION (original article): Lorpaiboon, W. and Limpanuparb, T. (2021). Z-matrix template-based substitution approach for enumeration of 3D molecular structures. MethodsX, 8. https://doi.org/10.1016%2Fj.mex.2021.101416
• The four steps required for Z-matrix template-based substitution are template construction, generation of tuples for substitution sites, removal of duplicate tuples and substitution on the template.
• The generated tuples can be used to create chemical identifiers to query compound properties from chemical databases.
• All of these steps are demonstrated in this paper by common model compounds and are very straightforward for an undergraduate audience to reproduce. A comparison of the approach in this paper and other options is also discussed. CITATION (original article): Lorpaiboon, W. and Limpanuparb, T. (2021). Z-matrix template-based substitution approach for enumeration of 3D molecular structures. MethodsX, 8. https://doi.org/10.1016%2Fj.mex.2021.101416
Introduction
Introduction
The exhaustive enumeration of 3D chemical structures based on Z - matrix templates has recently been used in the quantum chemical investigation of constitutional isomers, diastereomers and rotamers . This simple yet powerful initial structure generation approach can apply beyond the investigation of compounds of identical formula by quantum chemical methods . This notebook aims to provide a short description of the overall concept to the approach with the halo-substituted benzenes as an example.
The four steps required for Z - matrix template - based substitution are
1. Template construction
2. Generation of tuples for substitution sites
3. Removal of duplicate tuples
4. Substitution on the template
The four steps required for Z - matrix template - based substitution are
1. Template construction
2. Generation of tuples for substitution sites
3. Removal of duplicate tuples
4. Substitution on the template
1. Template construction
1. Template construction
The template can be manually constructed by hand from scratch in a text editor program such as Notepad++ or by editing a Z-matrix from a molecular graphic software such as IQmol. The template for the halo-substituted benzenes is as followed.
2. Generation of tuples for substitution sites
2. Generation of tuples for substitution sites
When generating halo-substituted benzenes, the possible substituents are H, F, Cl, Br and I atoms. Hence, elements = {“H”, “F”, “Cl”, “Br”, “I”}. Tuples[elements, k] generates a list all containing all possible k-tuples from the elements in elements. The number of tuples generated in this step is equivalent to where l is the length of elements and k is the size of each tuple. For benzene, possible substitutions for the slots a, b, c, d, e and f can be
represented as a 6-tuple (k = 6). Therefore, the number of tuples generated from this step is= 15625
k
l
represented as a 6-tuple (k = 6). Therefore, the number of tuples generated from this step is
6
5
In[]:=
elements={"H","F","Cl","Br","I"};all=Tuples[elements,6]
Out[]=
3. Removal of duplicate tuples
3. Removal of duplicate tuples
Each structure in the list of tuples all is rotated and flipped. If any of the resulting rotations or flips has been previously encountered, the corresponding tuple is discarded. Otherwise, the tuple is added to finalist. For any number of substituents n, this method has a complexity of O(). The number of tuples in finalist can be verified.
2
n
In[]:=
equiv[a_,i_,j_]:=Module[{f,s,k},(*Rotate/flipcompoundstofilteroutrepetitions*)f=Reverse[a[[i]]];(*Flipcompounds*)For[k=0,k<=5,k++,s=RotateLeft[a[[j]],k];(*Rotatecompounds*)If[a[[i]]==s||f==s,Break[]]];If[k<=5,True,False]];
In[]:=
n=Length[all];count=Table[0,{i,1,n}];For[i=1,i<n,i++,If[count[[i]]!=0,Continue[]];For[j=i+1,j<=n,j++,If[equiv[all,i,j],count[[j]]=i]]];//AbsoluteTiming(*Finallistofstructures*)finalist={};Count[count,0];For[i=1,i<=n,i++,If[count[[i]]==0,AppendTo[finalist,all[[i]]]]];Length[finalist]
Out[]=
{576.845,Null}
Out[]=
1505
Export[NotebookDirectory[]<>"fulllist_benzene.csv",finalist]
4. Substitution on the template
4. Substitution on the template
Once the collection of tuples has been modified from the previous steps, GNU sed is used to replace the labels a, b, c, d, e and f in the template with appropriate atoms from the tuples in finalist. For each tuple, the substitution would result in a 3D chemical structure that can be visualized with any molecular graphics software and used as input files for further calculation.
In[]:=
finalist=Import[NotebookDirectory[]<>"fulllist_benzene.csv","csv"];Length[finalist]dir="MP2";rn={};For[i=1,i≤Length[finalist],i++,If[Count[finalist〚i〛/.{"F""x","Cl""x","Br""x","I""x"},"x"]2,(*Filtercanbeappliedhere.Otherwise,changetheconditiontoTrue.Theexamplecodegivesdihalobenzenesonly.*)AppendTo[rn,{"cat benzene_template-"<>dir<>".inp | sed 's/a/"<>ToUpperCase[finalist〚i〛〚1〛]<>"/g;s/b/"<>ToUpperCase[finalist〚i〛〚2〛]<>"/g;s/c/"<>ToUpperCase[finalist〚i〛〚3〛]<>"/g;s/d/"<>ToUpperCase[finalist〚i〛〚4〛]<>"/g;s/e/"<>ToUpperCase[finalist〚i〛〚5〛]<>"/g;s/f/"<>ToUpperCase[finalist〚i〛〚6〛]<>"/g;' > "<>dir<>"/"<>StringJoin[finalist〚i〛]<>".inp"}]]]Length[rn]rn//TableForm
Out[]=
1505
Out[]=
30
The collection of commands in the table above can be saved into a script file. The file can be run on a UNIX operating system to generate the final structures based on the substitution of the template. The generated files can be opened in IQmol to visualize the 3D structure of the molecules or further used in Q-Chem calculation.
Extension to chemical identifiers and database queries
Extension to chemical identifiers and database queries
Linear notations are simple descriptions 3D structures and, more importantly, can be used as computer inputs. Many types of linear notations exist, namely the IUPAC international chemical identifier (InChI) and the simplified molecular-input line-entry (SMILES) system (used in this notebook). In the case of benzene, the template is
[a]C1=C([b])C([c])=C([d])C([e])=C1[f]
where the letters a to f can be substituted by each element in the tuple. SMILES strings for each 120 compound can be used to reference various properties of known compounds from databases. Each SMILES string can be submitted into the PubChem database to obtain a unique PubChem CID. This CID is also used to access compound properties in the database, including molecular formula and weight, other linear notations such as InChI and IUPAC name, and exact mass. In addition, various properties such as boiling and melting points can be obtained.
[a]C1=C([b])C([c])=C([d])C([e])=C1[f]
where the letters a to f can be substituted by each element in the tuple. SMILES strings for each 120 compound can be used to reference various properties of known compounds from databases. Each SMILES string can be submitted into the PubChem database to obtain a unique PubChem CID. This CID is also used to access compound properties in the database, including molecular formula and weight, other linear notations such as InChI and IUPAC name, and exact mass. In addition, various properties such as boiling and melting points can be obtained.
Create SMILES string
Create SMILES string
Search for PubChem CID
Search for PubChem CID
Obtain various properties from ChemicalData and PubChem
Obtain various properties from ChemicalData and PubChem
1. Boiling Point (C) versus Molar Mass (g/mol) for 20 halogenated benzenes
1. Boiling Point (C) versus Molar Mass (g/mol) for 20 halogenated benzenes
2. Compound structure and properties queried from PubChem
2. Compound structure and properties queried from PubChem
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Z-Matrix template-based substitution for enumeration of 3D molecules
by Piyathida Tawornparcha, Wanutcha Lorpaiboon, and Taweetham Limpanuparb
Wolfram Community, STAFF PICKS, September 10, 2021
https://community.wolfram.com/groups/-/m/t/2364528
by Piyathida Tawornparcha, Wanutcha Lorpaiboon, and Taweetham Limpanuparb
Wolfram Community, STAFF PICKS, September 10, 2021
https://community.wolfram.com/groups/-/m/t/2364528