<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=DB2_Visualizer</id>
	<title>DB2 Visualizer - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=DB2_Visualizer"/>
	<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=DB2_Visualizer&amp;action=history"/>
	<updated>2026-10-08T10:26:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>http://wiki.docking.org/index.php?title=DB2_Visualizer&amp;diff=17541&amp;oldid=prev</id>
		<title>Iamkaant at 20:17, 21 September 2026</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=DB2_Visualizer&amp;diff=17541&amp;oldid=prev"/>
		<updated>2026-09-21T20:17:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:17, 21 September 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l111&quot;&gt;Line 111:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 111:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== 2D figure ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== 2D figure ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:587277089.0.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;N_rigid&lt;/del&gt;.png|thumb|600px|none|2D figure for a molecule with three hierarchies. Top: all rigid fragments. Bottom: one panel per hierarchy.]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:587277089.0.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;N_rigi&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:1512441678.0.N rigid.png|thumb]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;d&lt;/ins&gt;.png|thumb|600px|none|2D figure for a molecule with three hierarchies. Top: all rigid fragments. Bottom: one panel per hierarchy.]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Each rigid fragment is highlighted in its own color (colorblind-friendly Okabe–Ito palette).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Each rigid fragment is highlighted in its own color (colorblind-friendly Okabe–Ito palette).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff::1.12:old-17539:rev-17541 --&gt;
&lt;/table&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=DB2_Visualizer&amp;diff=17539&amp;oldid=prev</id>
		<title>Iamkaant: initial commit</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=DB2_Visualizer&amp;diff=17539&amp;oldid=prev"/>
		<updated>2026-09-21T20:15:53Z</updated>

		<summary type="html">&lt;p&gt;initial commit&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;db2_viz.py&amp;#039;&amp;#039;&amp;#039; is a stand-alone Python script that visualizes a DOCK 3.x [[All About DB2 Files|DB2 file]] and highlights the &amp;#039;&amp;#039;&amp;#039;rigid fragment&amp;#039;&amp;#039;&amp;#039; of each hierarchy. It draws a 2D depiction with each rigid fragment in its own color, and can also write 3D files (a PyMOL script, an SDF file and an interactive HTML viewer) with the same highlighting.&lt;br /&gt;
&lt;br /&gt;
Use it to check which rigid fragments were used to build a ligand&amp;#039;s DB2 file, to compare the hierarchies of one molecule, or to look at the conformations (sets) stored in the file.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
A DB2 file holds one or more &amp;#039;&amp;#039;&amp;#039;hierarchies&amp;#039;&amp;#039;&amp;#039;. Each hierarchy is an entry that starts with &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; lines and ends with an &amp;lt;code&amp;gt;E&amp;lt;/code&amp;gt; line. The hierarchies of one molecule are built around different rigid fragments. DOCK places the rigid fragment first by matching it to the receptor spheres, and then builds the flexible part of the ligand from the stored conformations.&lt;br /&gt;
&lt;br /&gt;
The rigid fragment of a hierarchy is given by its &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; lines. Each &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; line holds the coordinates of one rigid atom. See [[All About DB2 Files]] for the full description of the line types.&lt;br /&gt;
&lt;br /&gt;
=== How the rigid atoms are found ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; lines do not store atom indices. The script finds each rigid atom by matching the &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; line coordinates to the &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; line coordinates (tolerance 0.001 Å). If a hierarchy has no &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; lines, the script uses the atoms of conformation 1.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; conformation 1 is not always the whole rigid fragment. It can be a single atom, with the rest of the rigid fragment spread over the next few conformations. Always use the &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; lines to identify the rigid fragment.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Python 3.9 or later&lt;br /&gt;
* [https://www.rdkit.org RDKit], matplotlib and numpy&lt;br /&gt;
&lt;br /&gt;
For example, with conda:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
conda create -n db2viz -c conda-forge python rdkit matplotlib numpy&lt;br /&gt;
conda activate db2viz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PyMOL is only needed to open the &amp;lt;code&amp;gt;.pml&amp;lt;/code&amp;gt; output. The script does not import PyMOL.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
On Gimel: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
conda activate &amp;lt;your Python env&amp;gt;&lt;br /&gt;
python /mnt/nfs/exa/work/ak87/UCSF/SCRIPTS/DOCKING/db2_viz.py ligand.db2 [options]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input can be a plain &amp;lt;code&amp;gt;.db2&amp;lt;/code&amp;gt; file or a gzipped &amp;lt;code&amp;gt;.db2.gz&amp;lt;/code&amp;gt; file. By default the script writes only the 2D figure. Add &amp;lt;code&amp;gt;--pymol&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--sdf&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--html&amp;lt;/code&amp;gt; to also write 3D files.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
2D figure only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python db2_viz.py 587277089.0.N.db2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2D figure with atom names, plus a PyMOL script, an SDF file and an HTML viewer:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python db2_viz.py 587277089.0.N.db2 --labels --pymol --sdf --html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Export the first 50 sets of each hierarchy as PyMOL states:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python db2_viz.py 587277089.0.N.db2 --pymol --all-sets --max-sets 50&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hierarchies 1 and 3 only, using the lowest-energy set, with an SVG figure:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python db2_viz.py 587277089.0.N.db2 --hierarchies 1,3 --set min -f svg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summary printed for the example file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
587277089.0: 3 hierarchies, 48 atoms, 52 bonds&lt;br /&gt;
  H1:  1353 confs   600 sets  rigid (7): C2 C3 C4 C5 C6 C7 S1&lt;br /&gt;
  H2:   763 confs   600 sets  rigid (15): C6 C7 N1 C8 C9 C10 C19 N3 N4 C20 C21 F1 F2 F3 C22&lt;br /&gt;
  H3:   800 confs   600 sets  rigid (12): C10 C11 C12 C13 O3 C14 C15 C16 Br1 C17 N2 C18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Option !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--out PREFIX&amp;lt;/code&amp;gt; || Output file prefix. Default: the input file name without &amp;lt;code&amp;gt;.db2&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;.db2.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--format {png,svg,pdf}&amp;lt;/code&amp;gt; || Format of the 2D figure. Default: &amp;lt;code&amp;gt;png&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--set N&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--set min&amp;lt;/code&amp;gt; || Set (conformation) used for the 3D outputs and for stereochemistry. &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt; is a 1-based set index. &amp;lt;code&amp;gt;min&amp;lt;/code&amp;gt; picks the non-broken set with the lowest value in the first energy column of the &amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt; lines. Default: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--hierarchies 1,3&amp;lt;/code&amp;gt; || Use only these hierarchies. Default: all.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--layout {auto,combined,panels,both}&amp;lt;/code&amp;gt; || Layout of the 2D figure. &amp;lt;code&amp;gt;combined&amp;lt;/code&amp;gt;: one panel with all rigid fragments. &amp;lt;code&amp;gt;panels&amp;lt;/code&amp;gt;: one panel per hierarchy. &amp;lt;code&amp;gt;both&amp;lt;/code&amp;gt;: both. &amp;lt;code&amp;gt;auto&amp;lt;/code&amp;gt; (default): &amp;lt;code&amp;gt;both&amp;lt;/code&amp;gt; if there is more than one hierarchy, otherwise &amp;lt;code&amp;gt;combined&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--show-h&amp;lt;/code&amp;gt; || Draw hydrogens in the 2D figure.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--labels&amp;lt;/code&amp;gt; || Label the atoms in the 2D figure with their DB2 atom names.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--no-2d&amp;lt;/code&amp;gt; || Do not write the 2D figure.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--pymol&amp;lt;/code&amp;gt; || Write a PyMOL script (&amp;lt;code&amp;gt;.pml&amp;lt;/code&amp;gt;).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sdf&amp;lt;/code&amp;gt; || Write an SDF file with the 3D poses.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--html&amp;lt;/code&amp;gt; || Write an interactive 3D viewer (&amp;lt;code&amp;gt;.html&amp;lt;/code&amp;gt;).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--all-sets&amp;lt;/code&amp;gt; || Export every set instead of one: as PyMOL states in the &amp;lt;code&amp;gt;.pml&amp;lt;/code&amp;gt; file and as separate records in the SDF file. It does not affect the HTML viewer.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--max-sets N&amp;lt;/code&amp;gt; || With &amp;lt;code&amp;gt;--all-sets&amp;lt;/code&amp;gt;, export only the first &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt; sets of each hierarchy.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--no-superpose&amp;lt;/code&amp;gt; || Keep each hierarchy in its original DB2 coordinate frame. By default, the 3D outputs superpose all hierarchies onto the first one.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Output ==&lt;br /&gt;
&lt;br /&gt;
All output files are named &amp;lt;code&amp;gt;PREFIX_rigid.EXT&amp;lt;/code&amp;gt;. If the DB2 file contains more than one molecule, each molecule gets its own files, named &amp;lt;code&amp;gt;PREFIX_MOLNAME_rigid.EXT&amp;lt;/code&amp;gt;. Hierarchies are grouped into molecules by the name on the first &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
=== 2D figure ===&lt;br /&gt;
&lt;br /&gt;
[[File:587277089.0.N_rigid.png|thumb|600px|none|2D figure for a molecule with three hierarchies. Top: all rigid fragments. Bottom: one panel per hierarchy.]]&lt;br /&gt;
&lt;br /&gt;
* Each rigid fragment is highlighted in its own color (colorblind-friendly Okabe–Ito palette).&lt;br /&gt;
* An atom that belongs to more than one rigid fragment is shown in all of their colors.&lt;br /&gt;
* If there is more than one hierarchy, a legend lists each hierarchy with the size of its rigid fragment and its numbers of conformations and sets.&lt;br /&gt;
* The figure title is the molecule name, followed by the SMILES string if the file contains a real one (not &amp;lt;code&amp;gt;fake&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The structure is built from the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; lines, so the script works even when the &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; line SMILES is &amp;lt;code&amp;gt;fake&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== PyMOL script (&amp;lt;code&amp;gt;--pymol&amp;lt;/code&amp;gt;) ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;.pml&amp;lt;/code&amp;gt; file contains all coordinates, so no other file is needed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pymol 587277089.0.N_rigid.pml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Each hierarchy is a separate object: &amp;lt;code&amp;gt;H1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;H2&amp;lt;/code&amp;gt;, and so on.&lt;br /&gt;
* The rigid atoms of each hierarchy are in a named selection: &amp;lt;code&amp;gt;H1_rigid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;H2_rigid&amp;lt;/code&amp;gt;, and so on.&lt;br /&gt;
* Rigid atoms are drawn as thick sticks with small spheres. Their carbons and hydrogens use the same color as in the 2D figure. The flexible part is drawn as thin gray sticks.&lt;br /&gt;
* Atom names are the DB2 atom names.&lt;br /&gt;
* With &amp;lt;code&amp;gt;--all-sets&amp;lt;/code&amp;gt;, each set is one state of the object.&lt;br /&gt;
&lt;br /&gt;
Useful commands after loading:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set grid_mode, 1                             # show the hierarchies side by side&lt;br /&gt;
hide everything, elem H and neighbor elem C  # hide nonpolar hydrogens&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SDF file (&amp;lt;code&amp;gt;--sdf&amp;lt;/code&amp;gt;) ===&lt;br /&gt;
&lt;br /&gt;
The SDF file has one record per hierarchy, or one record per set with &amp;lt;code&amp;gt;--all-sets&amp;lt;/code&amp;gt;. Each record stores these properties:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Property !! Content&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;hierarchy&amp;lt;/code&amp;gt; || Hierarchy number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;set&amp;lt;/code&amp;gt; || Set index&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;set_energies&amp;lt;/code&amp;gt; || Energy values from the &amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt; line of the set&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rigid_atom_indices&amp;lt;/code&amp;gt; || 1-based indices of the rigid atoms&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rigid_atom_names&amp;lt;/code&amp;gt; || DB2 names of the rigid atoms&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;atom_names&amp;lt;/code&amp;gt; || DB2 names of all atoms, in order&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== HTML viewer (&amp;lt;code&amp;gt;--html&amp;lt;/code&amp;gt;) ===&lt;br /&gt;
&lt;br /&gt;
The HTML file is an interactive 3D viewer based on [https://3dmol.csb.pitt.edu 3Dmol.js] that opens in any web browser.&lt;br /&gt;
&lt;br /&gt;
* Radio buttons switch between hierarchies. Each button shows the hierarchy&amp;#039;s color and its rigid atoms.&lt;br /&gt;
* A checkbox shows or hides the hydrogens.&lt;br /&gt;
* Hovering over an atom shows its DB2 atom name.&lt;br /&gt;
&lt;br /&gt;
The page loads 3Dmol.js from a CDN, so it needs an internet connection.&lt;br /&gt;
&lt;br /&gt;
== Notes and limitations ==&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Superposition.&amp;#039;&amp;#039;&amp;#039; Each hierarchy has its own coordinate frame, with its rigid fragment near the origin. The 3D outputs therefore superpose each hierarchy onto hierarchy 1 by least-squares fitting of all atoms of the chosen set. With &amp;lt;code&amp;gt;--all-sets&amp;lt;/code&amp;gt;, all sets of a hierarchy get the same transformation, so the states stay consistent with each other. Use &amp;lt;code&amp;gt;--no-superpose&amp;lt;/code&amp;gt; to keep the original coordinates, for example to compare them with the sphere positions.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Coordinates of a set.&amp;#039;&amp;#039;&amp;#039; The full coordinates of a set are the union of the &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; lines of its conformations (&amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt; lines). The script prints a warning if some atoms are left without coordinates.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Formal charges.&amp;#039;&amp;#039;&amp;#039; DB2 files do not store formal charges, so the script guesses them from atom valence. For example, 4-valent nitrogen gets +1 and 1-valent oxygen gets −1. &amp;lt;code&amp;gt;ar&amp;lt;/code&amp;gt; bonds to &amp;lt;code&amp;gt;O.co2&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;C.cat&amp;lt;/code&amp;gt; atoms (carboxylate, phosphate, amidinium) are turned into one double bond and single bonds. If RDKit cannot sanitize the molecule, the script prints a note and draws the structure without sanitization. In that case, the figure shows no stereochemistry.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;--set min&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; uses the first energy column of the &amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt; line header. It skips sets flagged as broken.&lt;br /&gt;
* &amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt; lines (clusters) are ignored.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[All About DB2 Files]]&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
</feed>