This repository contains a Perl script that was originally developed as part of the doctoral thesis "Dickenerkennung mit Cyclodextrinen und Synthese von Cyclodextrin-Rotaxanen aus Seitenkettenpolyrotaxanen" (English translation: "Thickness Recognition with Cyclodextrins and Synthesis of Cyclodextrin Rotaxanes from Side-Chain Polyrotaxanes") submitted to Saarland University in 2006.[1] The script was designed to profile host cavities and to determine molecular guest dimensions.
The repository’s purpose is to provide retrospective access to the code, as the original sources are no longer publicly available.
The equivalent-diameter algorithm MolShape determines molecular dimensions by scanning electron density maps along a defined molecular axis
The perl script molshape.pl implements this algorithm to characterize molecular dimensions from electron density data provided in Gaussian cube format.[3, 4] For host molecules such as cyclodextrins, it determines the minimum internal diameters along the molecular axis, thereby describing the geometry and constriction of the cavity. For guest molecules, the same procedure is applied to evaluate maximum molecular extensions relevant to host–guest inclusion.
The resulting parameters enable a direct comparison of host cavity sizes and guest molecular thicknesses, supporting quantitative predictions of inclusion selectivity and complex stability.[2]
| Program | min. Version | Task | Reference |
|---|---|---|---|
| Gaussian03 | Revision B.03 | Perform electron density calculations | [4] |
| formchk | Revision B.03 | Converts binary checkpoints (.chk) to formatted checkpoints (.fchk) |
[4] |
| cubegen | Revision B.03 | Generates volumetric data (e.g. electron density) from .fchk |
[3, 4] |
| Perl | 5.8 | Perl Interpreter with module Math::Trig |
[5] |
molshape.pl |
0.4 | Perl script for post-processing and shape analysis of cube files | [1] |
Although this workflow was only tested with Gaussian03, the cube file format has remained largely unchanged3 in later versions (Gaussian09, Gaussian16, Gaussian22). Therefore, it is reasonable to assume that molshape.pl remains compatible with cube files generated by newer Gaussian versions.
This repository hosts example files of every step in the folder examples/. The example molecule is an α-cyclodextrin.
-
Run a Gaussian calculation (here
g03) of a Gaussian job fileaCD.gjfto generate the binary checkpoint fileaCD.chk:g03 < aCD.gjf > aCD.log -
Convert the checkpoint to a formatted checkpoint file
aCD.fchkwithformchk(zipped) which is required to generate a cube file:formchk aCD.chk aCD.fchk -
Generate a cube file
aCD.cubeof the electron density in Bohr units withcubegen:cubegen 0 density=SCF aCD.fchk aCD.cube 0 h -
Run
molshape.plto calculate the equivalent radius$r_\mathrm{eq}(z)$ in Ångström between the atoms numbered4and8along the$z$ -axis (zxyorientation) and to generate the output filesaCD_molshape.csvfor evaluation and the corresponding cube fileaCD_molshape.cube(zipped) for visualization of the cavity:perl molshape.pl aCD.cube 4 8 zxyThis produces the following output:
Terminal output:
---------------------- MOLSHAPE (Version 0.4) ---------------------- Axis definition : z (main axis), x (secondary axis), y (secondary axis) Electron density cut-off: 0.002 electrons/Bohr^3 Number of atoms : 126 Number/length z-voxels : 58/0.362700 Bohr Number/length x-voxels : 92/0.362700 Bohr Number/length y-voxels : 97/0.362700 Bohr Voxel area (x,y) : 0.13155 Bohr^2 = 0.03684 A^2 OK: The read cube definition matches the cube dimensions! Cube-Zentrum (x,y) : (46,48) first z-voxel : 19 (atom number 4) last z-voxel : 39 (atom number 8) MolShape mode : Cavity mode OK: The file '.\examples\aCD_cavity_zxy_0.002.csv' was created successfully. OK: The file '.\examples\aCD_cavity_zxy_0.002.cube' was created successfully.CSV output file (
aCD_molshape.csv):slice, coord_rel, coord_abs, slicearea, integration, equiv_radius 19, 0.0000, -1.2964, 30.43, 5.84, 3.112 20, 0.1919, -1.1044, 29.62, 11.52, 3.070 21, 0.3839, -0.9125, 29.40, 17.17, 3.059 22, 0.5758, -0.7206, 29.25, 22.78, 3.051 23, 0.7677, -0.5286, 28.73, 28.30, 3.024 24, 0.9597, -0.3367, 26.85, 33.45, 2.924 25, 1.1516, -0.1448, 23.87, 38.03, 2.757 26, 1.3435, 0.0472, 20.85, 42.03, 2.576 27, 1.5355, 0.2391, 18.82, 45.65, 2.448 28, 1.7274, 0.4310, 17.02, 48.91, 2.328 29, 1.9193, 0.6230, 15.91, 51.97, 2.251 30, 2.1113, 0.8149, 15.07, 54.86, 2.190 31, 2.3032, 1.0068, 14.70, 57.68, 2.163 32, 2.4951, 1.1988, 14.62, 60.49, 2.158 33, 2.6871, 1.3907, 15.21, 63.41, 2.201 34, 2.8790, 1.5826, 16.14, 66.50, 2.266 35, 3.0709, 1.7746, 16.80, 69.73, 2.312 36, 3.2629, 1.9665, 17.76, 73.14, 2.377 37, 3.4548, 2.1584, 18.75, 76.74, 2.443 38, 3.6467, 2.3504, 19.12, 80.40, 2.467 39, 3.8387, 2.5423, 19.52, 84.15, 2.493The following flowchart illustrates the process from start (input geometry) to finish (
molshape.ploutput):Loadinggraph TB Input[/"Molecular input file<br>e.g. crystal structure, tinker output, ...<br>(.xyz, .gjf)"/] --> gaussian03 gaussian03 --> CHK[/"Gaussian checkpoint file<br>(.chk)"/] CHK --> formchk formchk --> FCHK[/"Formatted checkpoint file<br>(.fchk)"/] FCHK --> cubegen cubegen --> CUBE[/"Electron density as a Gaussian cube file<br>(.cube)"/] CUBE --> molshape.pl molshape.pl --> Output[/"CSV file with equivalent radii and a Gaussian cube file for visualization<br>(.csv, .cube)"/]
Check CITATION.cff if you want to cite this repository.
Or use the following references:
- Axel Müller, Gerhard Wenz, Chem. Eur. J., 2007, 13(8), 7225-7232.
- Axel Müller, "Dickenerkennung mit Cyclodextrinen und Synthese von Cyclodextrin-Rotaxanen aus Seitenkettenpolyrotaxanen", Dissertation, Saarland University, Saarbrücken (2006).
1 A. Müller, "Dickenerkennung mit Cyclodextrinen und Synthese von Cyclodextrin-Rotaxanen aus Seitenkettenpolyrotaxanen", Dissertation, Saarland University, Saarbrücken (2006). https://doi.org/10.1002/chem.200600764, https://d-nb.info/982680007
2 A. Müller, G. Wenz, Chem. Eur. J., 2007, 13(8), 7225-7232. https://doi.org/10.22028/D291-22351
3 P. Bourke, "Gaussian Cube Files", 2003. https://paulbourke.net/dataformats/cube/
4 M. J. Frisch, G. W. Trucks, H. B. Schlegel, G. E. Scuseria, M. A. Robb, J. R. Cheeseman, J. A. Montgomery, Jr., T. Vreven, K. N. Kudin, J. C. Burant, J. M. Millam, S. S. Iyengar, J. Tomasi, V. Barone, B. Mennucci, M. Cossi, G. Scalmani, N. Rega, G. A. Petersson, H. Nakatsuji, M. Hada, M. Ehara, K. Toyota, R. Fukuda, J. Hasegawa, M. Ishida, T. Nakajima, Y. Honda, O. Kitao, H. Nakai, M. Klene, X. Li, J. E. Knox, H. P. Hratchian, J. B. Cross, C. Adamo, J. Jaramillo, R. Gomperts, R. E. Stratmann, O. Yazyev, A. J. Austin, R. Cammi, C. Pomelli, J. W. Ochterski, P. Y. Ayala, K. Morokuma, G. A. Voth, P. Salvador, J. J. Dannenberg, V. G. Zakrzewski, S. Dapprich, A. D. Daniels, M. C. Strain, O. Farkas, D. K. Malick, A. D. Rabuck, K. Raghavachari, J. B. Foresman, J. V. Ortiz, Q. Cui, A. G. Baboul, S. Clifford, J. Cioslowski, B. B. Stefanov, G. Liu, A. Liashenko, P. Piskorz, I. Komaromi, R. L. Martin, D. J. Fox, T. Keith, M. A. Al-Laham, C. Y. Peng, A. Nanayakkara, M. Challacombe, P. M. W. Gill, B. Johnson, W. Chen, M. W. Wong, C. Gonzalez, and J. A. Pople, "Gaussian 03, Revision B.03", Gaussian Inc., Pittsburgh PA (USA), 2003. https://gaussian.com/
5 N. Clark, "Perl 5.8.8 Release Announcement", 2006. https://dev.perl.org/perl5/news/2006/perl-5.8.8.html