forked from cclib/cclib.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
how_to_parse.html
476 lines (353 loc) · 32.4 KB
/
how_to_parse.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>How to parse and write — cclib 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/increase_max_width.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Parsed data (version 1.7.1)" href="data.html" />
<link rel="prev" title="How to install" href="how_to_install.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="contents.html" class="icon icon-home"> cclib
</a>
<div class="version">
1.7
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="how_to_install.html">How to install</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">How to parse and write</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#from-python">From Python</a></li>
<li class="toctree-l2"><a class="reference internal" href="#from-command-line">From command line</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#ccget">ccget</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#chaining-of-attributes">Chaining of attributes</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#ccwrite">ccwrite</a></li>
<li class="toctree-l3"><a class="reference internal" href="#ccframe">ccframe</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Parsed data (version 1.7.1)</a></li>
<li class="toctree-l1"><a class="reference internal" href="data_notes.html">Parsed data notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="methods.html">Calculation methods</a></li>
<li class="toctree-l1"><a class="reference internal" href="bridge.html">Bridges to other packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="development.html">Development</a></li>
<li class="toctree-l1"><a class="reference internal" href="data_dev.html">Development parsed data</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="contents.html">cclib</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="contents.html" class="icon icon-home"></a> »</li>
<li>How to parse and write</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/cclib/cclib/blob/master/doc/sphinx/how_to_parse.rst" class="fa fa-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="how-to-parse-and-write">
<h1>How to parse and write<a class="headerlink" href="#how-to-parse-and-write" title="Permalink to this headline">¶</a></h1>
<p>This page outlines the various ways cclib can be used to parse and write logfiles, and provides several examples to get you started.</p>
<div class="section" id="from-python">
<h2>From Python<a class="headerlink" href="#from-python" title="Permalink to this headline">¶</a></h2>
<p>Importing cclib and parsing a file is a few lines of Python code, making it simple to access data from the output file of any supported computational chemistry program. For example:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">cclib</span>
<span class="gp">>>> </span><span class="n">filename</span> <span class="o">=</span> <span class="s2">"water.out"</span>
<span class="gp">>>> </span><span class="n">parser</span> <span class="o">=</span> <span class="n">cclib</span><span class="o">.</span><span class="n">io</span><span class="o">.</span><span class="n">ccopen</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">data</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">parse</span><span class="p">()</span>
<span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="s2">"There are </span><span class="si">%i</span><span class="s2"> atoms and </span><span class="si">%i</span><span class="s2"> MOs"</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">natom</span><span class="p">,</span> <span class="n">data</span><span class="o">.</span><span class="n">nmo</span><span class="p">))</span>
<span class="go">There are 3 atoms and 7 MOs</span>
</pre></div>
</div>
<p>A newer command, <code class="docutils literal notranslate"><span class="pre">ccread</span></code>, combines both the format detection and parsing steps:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">cclib</span>
<span class="gp">>>> </span><span class="n">filename</span> <span class="o">=</span> <span class="s2">"logfile.out"</span>
<span class="gp">>>> </span><span class="n">data</span> <span class="o">=</span> <span class="n">cclib</span><span class="o">.</span><span class="n">io</span><span class="o">.</span><span class="n">ccread</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
<span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="s2">"There are </span><span class="si">%i</span><span class="s2"> atoms and </span><span class="si">%i</span><span class="s2"> MOs"</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">natom</span><span class="p">,</span> <span class="n">data</span><span class="o">.</span><span class="n">nmo</span><span class="p">))</span>
<span class="go">There are 3 atoms and 7 MOs</span>
</pre></div>
</div>
<p>The <cite>data</cite> object above contains all the information cclib was able to to parse from the output file, available as attributes on the object:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="nb">dir</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="go">[(...), 'atomcoords', 'atommasses', 'atomnos', 'charge', (...), 'mult', 'natom, 'nbasis', ...]</span>
</pre></div>
</div>
<p>You can find a full list of these attribute on the <a class="reference external" href="data.html">parsed data</a> page.</p>
</div>
<div class="section" id="from-command-line">
<h2>From command line<a class="headerlink" href="#from-command-line" title="Permalink to this headline">¶</a></h2>
<p>The cclib package provides four scripts to parse and write data: <code class="docutils literal notranslate"><span class="pre">ccget</span></code>, <code class="docutils literal notranslate"><span class="pre">ccwrite</span></code>, <code class="docutils literal notranslate"><span class="pre">cda</span></code>, and <code class="docutils literal notranslate"><span class="pre">ccframe</span></code>.</p>
<ol class="arabic simple">
<li><p><strong>ccget</strong> is used to parse attribute data from output files.</p></li>
<li><p><strong>ccwrite</strong> has the ability to list out all valid attribute data that can be parsed from an output format. It has the added feature of writing the output file into four different formats i.e. <code class="docutils literal notranslate"><span class="pre">json</span></code>, <code class="docutils literal notranslate"><span class="pre">cjson</span></code>, <code class="docutils literal notranslate"><span class="pre">cml</span></code>, <code class="docutils literal notranslate"><span class="pre">xyz</span></code>.</p></li>
<li><p><strong>cda</strong> is used for the chemical decomposition analysis of output files.</p></li>
<li><p><strong>ccframe</strong> is used to write data tables from output files.</p></li>
</ol>
<p>This page describes how to use the ccget, ccwrite and ccframe scripts to obtain data from output files.</p>
<div class="section" id="ccget">
<h3>ccget<a class="headerlink" href="#ccget" title="Permalink to this headline">¶</a></h3>
<p>The data types that can be parsed from the output file depends on the type of computation being conducted. The name of the output file used to show example usage is <code class="docutils literal notranslate"><span class="pre">Benzeneselenol.out</span></code>.</p>
<p>Data type can be parsed from the output file by following this format:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ccget</span> <span class="o"><</span><span class="n">attribute</span><span class="o">></span> <span class="p">[</span><span class="o"><</span><span class="n">attribute</span><span class="o">></span><span class="p">]</span> <span class="o"><</span><span class="n">CompChemLogFile</span><span class="o">></span> <span class="p">[</span><span class="o"><</span><span class="n">CompChemLogFile</span><span class="o">></span><span class="p">]</span>
</pre></div>
</div>
<p>where <code class="docutils literal notranslate"><span class="pre">attribute</span></code> can be any one of the attribute names available <a class="reference external" href="data_dev.html">here</a>.</p>
<ol class="arabic">
<li><p>Atomic Charges</p>
<blockquote>
<div><p>The atomic charges are obtained by using the <code class="docutils literal notranslate"><span class="pre">atomcharges</span></code> attribute:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ ccget atomcharges Benzeneselenol.out
Attempting to read Benzeneselenol.out
atomcharges:
{'mulliken': array([-0.49915 , 0.056965, 0.172161, 0.349794, -0.153072, 0.094583,
0.016487, 0.050249, 0.002149, 0.01161 , 0.053777, -0.173671,
0.018118])}
</pre></div>
</div>
</div></blockquote>
</li>
<li><p>Electronic Energies</p>
<blockquote>
<div><p>The molecular electronic energies after SCF (DFT) optimization of the input molecule are printed by using the <code class="docutils literal notranslate"><span class="pre">scfenergies</span></code> attribute:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ ccget scfenergies Benzeneselenol.out
Attempting to read Benzeneselenol.out
scfenergies:
[-71671.43702915 -71671.4524142 -71671.4534768 -71671.45447492
-71671.4556548 -71671.45605671 -71671.43194906 -71671.45761021
-71671.45850275 -71671.39630296 -71671.45915119 -71671.45935854
-71671.4594614 -71671.45947338 -71671.45948807 -71671.4594946
-71671.4594946 ]
</pre></div>
</div>
</div></blockquote>
</li>
<li><p>Geometry Targets</p>
<blockquote>
<div><p>The targets for convergence of geometry optimization can be obtained by using the <code class="docutils literal notranslate"><span class="pre">geotargets</span></code> attribute:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ ccget geotargets Benzeneselenol.out
Attempting to read Benzeneselenol.out
geotargets:
[ 0.00045 0.0003 0.0018 0.0012 ]
</pre></div>
</div>
</div></blockquote>
</li>
</ol>
<div class="section" id="chaining-of-attributes">
<h4>Chaining of attributes<a class="headerlink" href="#chaining-of-attributes" title="Permalink to this headline">¶</a></h4>
<p>ccget provides the user with the option to chain attributes to obtain more than one type of data with a command call. The attributes can be chained in any particular order. A few chained examples are provided below.</p>
<ol class="arabic">
<li><p>Molecular Orbitals and Multiplicity</p>
<blockquote>
<div><p>The number of molecular orbitals and the number of basis functions used to optimize the molecule can be obtained by running the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ ccget nmo nbasis Benzeneselenol.out
Attempting to read Benzeneselenol.out
nmo:
405
nbasis:
407
</pre></div>
</div>
</div></blockquote>
</li>
<li><p>Enthalpy and Vibrational Frequency</p>
<blockquote>
<div><p>The enthalpy and the vibrational frequencies of the optimized molecule is conducted is obtained below:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ ccget enthalpy vibfreqs Benzeneselenol.out
Attempting to read Benzeneselenol.out
enthalpy:
-2633.77264
vibfreqs:
[ 129.5512 170.6681 231.4278 304.8614 407.8299 472.5026
629.9087 679.9032 693.2509 746.7694 812.5113 850.2578
915.8742 987.1252 988.1785 1002.8922 1038.1073 1091.4005
1102.3417 1183.3857 1209.2727 1311.3497 1355.6441 1471.4447
1510.1919 1611.9088 1619.0156 2391.2487 3165.1596 3171.3909
3182.0753 3188.5786 3198.0359]
</pre></div>
</div>
</div></blockquote>
</li>
</ol>
</div>
</div>
<div class="section" id="ccwrite">
<h3>ccwrite<a class="headerlink" href="#ccwrite" title="Permalink to this headline">¶</a></h3>
<p>The same Benzeneselenol.out file used in the previous examples will be used as the input file for ccwrite. When the ccwrite script is used with a valid input, it prints out the valid attributes that can be parsed from the file.</p>
<p>Command line format:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ccwrite</span> <span class="o"><</span><span class="n">OutputFileFormat</span><span class="o">></span> <span class="o"><</span><span class="n">CompChemLogFile</span><span class="o">></span> <span class="p">[</span><span class="o"><</span><span class="n">CompChemLogFile</span><span class="o">></span><span class="p">]</span>
</pre></div>
</div>
<p>The valid output file formats are <code class="docutils literal notranslate"><span class="pre">cjson</span></code>, <code class="docutils literal notranslate"><span class="pre">cml</span></code>, and <code class="docutils literal notranslate"><span class="pre">xyz</span></code>.</p>
<ol class="arabic">
<li><p><a class="reference external" href="http://www.xml-cml.org/">Chemical markup language</a> (CML):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ ccwrite cml Benzeneselenol.out
Attempting to parse Benzeneselenol.out
cclib can parse the following attributes from Benzeneselenol.out:
atomcharges
atomcoords
atomnos
charge
coreelectrons
enthalpy
geotargets
geovalues
grads
homos
moenergies
mosyms
mult
natom
nbasis
nmo
optdone
optstatus
scfenergies
scftargets
temperature
vibdisps
vibfreqs
vibirs
vibsyms
</pre></div>
</div>
</li>
</ol>
<p>A <code class="docutils literal notranslate"><span class="pre">Benzeneselenol.cml</span></code> output file is generated in the same directory as the <code class="docutils literal notranslate"><span class="pre">Benzeneselenol.out</span></code> file:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="cp"><?xml version='1.0' encoding='utf-8'?></span>
<span class="nt"><molecule</span> <span class="na">id=</span><span class="s">"Benzeneselenol.out"</span> <span class="na">xmlns=</span><span class="s">"http://www.xml-cml.org/schema"</span><span class="nt">></span>
<span class="nt"><atomArray></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"C"</span> <span class="na">id=</span><span class="s">"a1"</span> <span class="na">x3=</span><span class="s">"-2.8947620000"</span> <span class="na">y3=</span><span class="s">"-0.0136420000"</span> <span class="na">z3=</span><span class="s">"-0.0015280000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"C"</span> <span class="na">id=</span><span class="s">"a2"</span> <span class="na">x3=</span><span class="s">"-2.2062510000"</span> <span class="na">y3=</span><span class="s">"1.1938510000"</span> <span class="na">z3=</span><span class="s">"-0.0025210000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"C"</span> <span class="na">id=</span><span class="s">"a3"</span> <span class="na">x3=</span><span class="s">"-0.8164260000"</span> <span class="na">y3=</span><span class="s">"1.2153020000"</span> <span class="na">z3=</span><span class="s">"-0.0022010000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"C"</span> <span class="na">id=</span><span class="s">"a4"</span> <span class="na">x3=</span><span class="s">"-0.1033520000"</span> <span class="na">y3=</span><span class="s">"0.0183920000"</span> <span class="na">z3=</span><span class="s">"0.0031060000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"C"</span> <span class="na">id=</span><span class="s">"a5"</span> <span class="na">x3=</span><span class="s">"-0.7906630000"</span> <span class="na">y3=</span><span class="s">"-1.1943840000"</span> <span class="na">z3=</span><span class="s">"0.0058500000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"C"</span> <span class="na">id=</span><span class="s">"a6"</span> <span class="na">x3=</span><span class="s">"-2.1799570000"</span> <span class="na">y3=</span><span class="s">"-1.2059710000"</span> <span class="na">z3=</span><span class="s">"0.0017890000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"H"</span> <span class="na">id=</span><span class="s">"a7"</span> <span class="na">x3=</span><span class="s">"-3.9758430000"</span> <span class="na">y3=</span><span class="s">"-0.0253010000"</span> <span class="na">z3=</span><span class="s">"-0.0029040000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"H"</span> <span class="na">id=</span><span class="s">"a8"</span> <span class="na">x3=</span><span class="s">"-2.7502340000"</span> <span class="na">y3=</span><span class="s">"2.1291370000"</span> <span class="na">z3=</span><span class="s">"-0.0052760000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"H"</span> <span class="na">id=</span><span class="s">"a9"</span> <span class="na">x3=</span><span class="s">"-0.2961840000"</span> <span class="na">y3=</span><span class="s">"2.1630180000"</span> <span class="na">z3=</span><span class="s">"-0.0073260000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"H"</span> <span class="na">id=</span><span class="s">"a10"</span> <span class="na">x3=</span><span class="s">"-0.2474670000"</span> <span class="na">y3=</span><span class="s">"-2.1302310000"</span> <span class="na">z3=</span><span class="s">"0.0132260000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"H"</span> <span class="na">id=</span><span class="s">"a11"</span> <span class="na">x3=</span><span class="s">"-2.7028960000"</span> <span class="na">y3=</span><span class="s">"-2.1530750000"</span> <span class="na">z3=</span><span class="s">"0.0036640000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"Se"</span> <span class="na">id=</span><span class="s">"a12"</span> <span class="na">x3=</span><span class="s">"1.8210800000"</span> <span class="na">y3=</span><span class="s">"-0.0433780000"</span> <span class="na">z3=</span><span class="s">"-0.0038760000"</span> <span class="nt">/></span>
<span class="nt"><atom</span> <span class="na">elementType=</span><span class="s">"H"</span> <span class="na">id=</span><span class="s">"a13"</span> <span class="na">x3=</span><span class="s">"2.0043580000"</span> <span class="na">y3=</span><span class="s">"1.4100070000"</span> <span class="na">z3=</span><span class="s">"0.1034490000"</span> <span class="nt">/></span>
<span class="nt"></atomArray></span>
<span class="nt"><bondArray></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a9 a3"</span> <span class="na">order=</span><span class="s">"1"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a8 a2"</span> <span class="na">order=</span><span class="s">"1"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a12 a4"</span> <span class="na">order=</span><span class="s">"1"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a12 a13"</span> <span class="na">order=</span><span class="s">"1"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a7 a1"</span> <span class="na">order=</span><span class="s">"1"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a2 a3"</span> <span class="na">order=</span><span class="s">"2"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a2 a1"</span> <span class="na">order=</span><span class="s">"1"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a3 a4"</span> <span class="na">order=</span><span class="s">"1"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a1 a6"</span> <span class="na">order=</span><span class="s">"2"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a6 a11"</span> <span class="na">order=</span><span class="s">"1"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a6 a5"</span> <span class="na">order=</span><span class="s">"1"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a4 a5"</span> <span class="na">order=</span><span class="s">"2"</span> <span class="nt">/></span>
<span class="nt"><bond</span> <span class="na">atomRefs2=</span><span class="s">"a5 a10"</span> <span class="na">order=</span><span class="s">"1"</span> <span class="nt">/></span>
<span class="nt"></bondArray></span>
<span class="nt"></molecule></span>
</pre></div>
</div>
<ol class="arabic simple" start="2">
<li><p><a class="reference external" href="https://en.wikipedia.org/wiki/XYZ_file_format">XYZ</a></p></li>
</ol>
<p>Using <code class="docutils literal notranslate"><span class="pre">xyz</span></code> as the <code class="docutils literal notranslate"><span class="pre"><OutputFileFormat></span></code> with <code class="docutils literal notranslate"><span class="pre">Benzeneselenol.out</span></code>, we obtain the following <code class="docutils literal notranslate"><span class="pre">Benzeneselenol.xyz</span></code> file:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">13</span>
<span class="n">Benzeneselenol</span><span class="o">.</span><span class="n">out</span><span class="p">:</span> <span class="n">Geometry</span> <span class="mi">17</span>
<span class="n">C</span> <span class="o">-</span><span class="mf">2.8947620000</span> <span class="o">-</span><span class="mf">0.0136420000</span> <span class="o">-</span><span class="mf">0.0015280000</span>
<span class="n">C</span> <span class="o">-</span><span class="mf">2.2062510000</span> <span class="mf">1.1938510000</span> <span class="o">-</span><span class="mf">0.0025210000</span>
<span class="n">C</span> <span class="o">-</span><span class="mf">0.8164260000</span> <span class="mf">1.2153020000</span> <span class="o">-</span><span class="mf">0.0022010000</span>
<span class="n">C</span> <span class="o">-</span><span class="mf">0.1033520000</span> <span class="mf">0.0183920000</span> <span class="mf">0.0031060000</span>
<span class="n">C</span> <span class="o">-</span><span class="mf">0.7906630000</span> <span class="o">-</span><span class="mf">1.1943840000</span> <span class="mf">0.0058500000</span>
<span class="n">C</span> <span class="o">-</span><span class="mf">2.1799570000</span> <span class="o">-</span><span class="mf">1.2059710000</span> <span class="mf">0.0017890000</span>
<span class="n">H</span> <span class="o">-</span><span class="mf">3.9758430000</span> <span class="o">-</span><span class="mf">0.0253010000</span> <span class="o">-</span><span class="mf">0.0029040000</span>
<span class="n">H</span> <span class="o">-</span><span class="mf">2.7502340000</span> <span class="mf">2.1291370000</span> <span class="o">-</span><span class="mf">0.0052760000</span>
<span class="n">H</span> <span class="o">-</span><span class="mf">0.2961840000</span> <span class="mf">2.1630180000</span> <span class="o">-</span><span class="mf">0.0073260000</span>
<span class="n">H</span> <span class="o">-</span><span class="mf">0.2474670000</span> <span class="o">-</span><span class="mf">2.1302310000</span> <span class="mf">0.0132260000</span>
<span class="n">H</span> <span class="o">-</span><span class="mf">2.7028960000</span> <span class="o">-</span><span class="mf">2.1530750000</span> <span class="mf">0.0036640000</span>
<span class="n">Se</span> <span class="mf">1.8210800000</span> <span class="o">-</span><span class="mf">0.0433780000</span> <span class="o">-</span><span class="mf">0.0038760000</span>
<span class="n">H</span> <span class="mf">2.0043580000</span> <span class="mf">1.4100070000</span> <span class="mf">0.1034490000</span>
</pre></div>
</div>
</div>
<div class="section" id="ccframe">
<h3>ccframe<a class="headerlink" href="#ccframe" title="Permalink to this headline">¶</a></h3>
<p>This script creates complete tables of data from output files in some of the formats supported by <a class="reference external" href="https://pandas.pydata.org/">pandas</a>.
Since the pandas library is not a dependency of cclib, <a class="reference external" href="https://pandas.pydata.org/pandas-docs/stable/install.html">it must be installed</a> separately.</p>
<p>A complete data table can be parsed from many output files by following this format:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ccframe</span> <span class="p">[</span><span class="o">--</span><span class="n">force</span><span class="o">|-</span><span class="n">f</span><span class="p">]</span> <span class="o">-</span><span class="n">O</span> <span class="o"><</span><span class="n">OutputDest</span><span class="o">></span> <span class="o"><</span><span class="n">CompChemLogFile</span><span class="o">></span> <span class="p">[</span><span class="o"><</span><span class="n">CompChemLogFile</span><span class="o">>...</span><span class="p">]</span>
</pre></div>
</div>
<p>The argument for <code class="docutils literal notranslate"><span class="pre">-O</span></code> indicates the data file to be written and its extension specifies the filetype (e.g. csv, h5/hdf/hdf5, json, pickle/pkl, xlsx).
An error will be thrown if <code class="docutils literal notranslate"><span class="pre"><OutputDest></span></code> already exists, but you can force overwriting by using the <code class="docutils literal notranslate"><span class="pre">--force</span></code> (or <code class="docutils literal notranslate"><span class="pre">-f</span></code>) flag.
Since higher-dimensional attributes (e.g. <code class="docutils literal notranslate"><span class="pre">atomcoords</span></code>) are handled as plain text in some file formats (such as Excel XLSX or CSV), we recommend storing JSON or HDF5 files.
Observe that the output data file is overwritten if it exits already.</p>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="data.html" class="btn btn-neutral float-right" title="Parsed data (version 1.7.1)" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="how_to_install.html" class="btn btn-neutral float-left" title="How to install" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2014-2021, cclib Development Team.
</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>