<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_mol__compare_8h">
<title>/Users/bernard/b20/bsoft/include/mol_compare.h File Reference</title>
<indexterm><primary>/Users/bernard/b20/bsoft/include/mol_compare.h</primary></indexterm>
<para>

<para>Library routines used to compare sets of atomic coordinates. </para>
 
</para>
<programlisting>#include &quot;Transform.h&quot;
#include &quot;rwmolecule.h&quot;
</programlisting><simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para>double <link linkend="_mol__compare_8h_1acb47070621dc922325f3c05df60c78b4">molgroup_rotate_and_compare</link> (<link linkend="_struct_bmolgroup">Bmolgroup</link> *molgroup, <link linkend="_class_transform">Transform</link> t)</para>

<para>Copies and rotates the molecule group and compares it with the original. </para>
</listitem>
            <listitem><para><link linkend="_class_transform">Transform</link> <link linkend="_mol__compare_8h_1a403d7d98f7f804d66a832b0d03f64f39">molgroup_find_transformation</link> (<link linkend="_struct_bmolgroup">Bmolgroup</link> *molgroup1, <link linkend="_struct_bmolgroup">Bmolgroup</link> *molgroup2)</para>

<para>Determines the transformation between two groups of identical molecules. </para>
</listitem>
            <listitem><para><link linkend="_class_transform">Transform</link> <link linkend="_mol__compare_8h_1a55628c3310c11036bca520c234a0872e">mol_find_transformation</link> (<link linkend="_struct_bmolecule">Bmolecule</link> *mol1, <link linkend="_struct_bmolecule">Bmolecule</link> *mol2, int offset)</para>

<para>Determines the transformation between two identical molecules. </para>
</listitem>
            <listitem><para>double <link linkend="_mol__compare_8h_1a62a2366262cf50991306b84f15a6320a">molgroup_calculate_rmsd</link> (<link linkend="_struct_bmolgroup">Bmolgroup</link> *molgroup, <link linkend="_struct_bmolgroup">Bmolgroup</link> *molgroup2)</para>

<para>Calculates the root-mean-square-deviation between two molecule groups. </para>
</listitem>
            <listitem><para>double <link linkend="_mol__compare_8h_1aa80e7de9ef8358efe94d834af1f733b8">mol_calculate_rmsd</link> (<link linkend="_struct_bmolecule">Bmolecule</link> *mol1, <link linkend="_struct_bmolecule">Bmolecule</link> *mol2)</para>

<para>Calculates the RMSD between two molecules. </para>
</listitem>
            <listitem><para>double <link linkend="_mol__compare_8h_1a622e2b045ed31fc922a6ecccbcb0d81f">molgroup_calc_brute_rmsd</link> (<link linkend="_struct_bmolgroup">Bmolgroup</link> *molgroup1, <link linkend="_struct_bmolgroup">Bmolgroup</link> *molgroup2)</para>

<para>Calculates the RMSD based on nearest atoms. </para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Library routines used to compare sets of atomic coordinates. </para>

<para><formalpara><title>Author: </title>

<para>Bernard Heymann </para>
</formalpara>
<formalpara><title>Date: </title>

<para>Created: 20021020 </para>

<para>Modified: 20070810 </para>
</formalpara>
</para>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_mol__compare_8h_1aa80e7de9ef8358efe94d834af1f733b8"/>    <section>
    <title>mol_calculate_rmsd()</title>
<indexterm><primary>mol_calculate_rmsd</primary><secondary>mol_compare.h</secondary></indexterm>
<indexterm><primary>mol_compare.h</primary><secondary>mol_calculate_rmsd</secondary></indexterm>
<para><computeroutput>double mol_calculate_rmsd (<link linkend="_struct_bmolecule">Bmolecule</link> * mol1, <link linkend="_struct_bmolecule">Bmolecule</link> * mol2)</computeroutput></para><para>

<para>Calculates the RMSD between two molecules. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*mol1</entry>
                                <entry>
<para>first molecule. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mol2</entry>
                                <entry>
<para>second molecule. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double RMSD. <literallayout><computeroutput>The root-mean-square-deviation between two sets of corrdinates is given by:
    R = sqrt(sum(length(coord1-coord2))/number).
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 270 of file mol_compare.cpp.</para>
    </section><anchor xml:id="_mol__compare_8h_1a55628c3310c11036bca520c234a0872e"/>    <section>
    <title>mol_find_transformation()</title>
<indexterm><primary>mol_find_transformation</primary><secondary>mol_compare.h</secondary></indexterm>
<indexterm><primary>mol_compare.h</primary><secondary>mol_find_transformation</secondary></indexterm>
<para><computeroutput><link linkend="_class_transform">Transform</link> mol_find_transformation (<link linkend="_struct_bmolecule">Bmolecule</link> * mol1, <link linkend="_struct_bmolecule">Bmolecule</link> * mol2, int offset)</computeroutput></para><para>

<para>Determines the transformation between two identical molecules. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*mol1</entry>
                                <entry>
<para>first molecule. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mol2</entry>
                                <entry>
<para>second molecule. </para>
</entry>
                            </row>
                            <row>
                                <entry>offset</entry>
                                <entry>
<para>offset of second sequence with respect to first. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_transform">Transform</link> transform structure. <literallayout><computeroutput>The transformation:
    coord2 = rot_mat * (coord1 - origin) + origin + shift
is solved.
The algorithm is set up in parts, solving first for:
    coord2 = rot_mat * coord1 + shift_temp
The last term is given by:
    shift_temp = shift + origin - rot_mat * origin
The shift vector must be parallel to the rotation axis, and is
determined as:
    shift = axis * |shift_temp| * cos(alpha)
where alpha is the angle between shift_temp and the rotation axis.
The origin is then calculated from:
    origin = (shift_temp - shift) * inverse(id_mat - rot_mat)
Note that the origin still has one degree of freedom: It can be
anywhere along the rotation axis.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 139 of file mol_compare.cpp.</para>
    </section><anchor xml:id="_mol__compare_8h_1a622e2b045ed31fc922a6ecccbcb0d81f"/>    <section>
    <title>molgroup_calc_brute_rmsd()</title>
<indexterm><primary>molgroup_calc_brute_rmsd</primary><secondary>mol_compare.h</secondary></indexterm>
<indexterm><primary>mol_compare.h</primary><secondary>molgroup_calc_brute_rmsd</secondary></indexterm>
<para><computeroutput>double molgroup_calc_brute_rmsd (<link linkend="_struct_bmolgroup">Bmolgroup</link> * molgroup1, <link linkend="_struct_bmolgroup">Bmolgroup</link> * molgroup2)</computeroutput></para><para>

<para>Calculates the RMSD based on nearest atoms. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*molgroup1</entry>
                                <entry>
<para>first molecule group. </para>
</entry>
                            </row>
                            <row>
                                <entry>*molgroup2</entry>
                                <entry>
<para>second molecule group. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double RMSD. </para>
</formalpara>
</para>
<para>
Definition at line 314 of file mol_compare.cpp.</para>
    </section><anchor xml:id="_mol__compare_8h_1a62a2366262cf50991306b84f15a6320a"/>    <section>
    <title>molgroup_calculate_rmsd()</title>
<indexterm><primary>molgroup_calculate_rmsd</primary><secondary>mol_compare.h</secondary></indexterm>
<indexterm><primary>mol_compare.h</primary><secondary>molgroup_calculate_rmsd</secondary></indexterm>
<para><computeroutput>double molgroup_calculate_rmsd (<link linkend="_struct_bmolgroup">Bmolgroup</link> * molgroup1, <link linkend="_struct_bmolgroup">Bmolgroup</link> * molgroup2)</computeroutput></para><para>

<para>Calculates the root-mean-square-deviation between two molecule groups. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*molgroup1</entry>
                                <entry>
<para>first molecule group. </para>
</entry>
                            </row>
                            <row>
                                <entry>*molgroup2</entry>
                                <entry>
<para>second molecule group. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double root-mean-square-deviation. <literallayout><computeroutput>The two molecule groups must have identical structures.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 213 of file mol_compare.cpp.</para>
    </section><anchor xml:id="_mol__compare_8h_1a403d7d98f7f804d66a832b0d03f64f39"/>    <section>
    <title>molgroup_find_transformation()</title>
<indexterm><primary>molgroup_find_transformation</primary><secondary>mol_compare.h</secondary></indexterm>
<indexterm><primary>mol_compare.h</primary><secondary>molgroup_find_transformation</secondary></indexterm>
<para><computeroutput><link linkend="_class_transform">Transform</link> molgroup_find_transformation (<link linkend="_struct_bmolgroup">Bmolgroup</link> * molgroup1, <link linkend="_struct_bmolgroup">Bmolgroup</link> * molgroup2)</computeroutput></para><para>

<para>Determines the transformation between two groups of identical molecules. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*molgroup1</entry>
                                <entry>
<para>first molecule group. </para>
</entry>
                            </row>
                            <row>
                                <entry>*molgroup2</entry>
                                <entry>
<para>second molecule group. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_transform">Transform</link> transform structure. </para>
</formalpara>
</para>
<para>
Definition at line 51 of file mol_compare.cpp.</para>
    </section><anchor xml:id="_mol__compare_8h_1acb47070621dc922325f3c05df60c78b4"/>    <section>
    <title>molgroup_rotate_and_compare()</title>
<indexterm><primary>molgroup_rotate_and_compare</primary><secondary>mol_compare.h</secondary></indexterm>
<indexterm><primary>mol_compare.h</primary><secondary>molgroup_rotate_and_compare</secondary></indexterm>
<para><computeroutput>double molgroup_rotate_and_compare (<link linkend="_struct_bmolgroup">Bmolgroup</link> * molgroup, <link linkend="_class_transform">Transform</link> t)</computeroutput></para><para>

<para>Copies and rotates the molecule group and compares it with the original. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*molgroup</entry>
                                <entry>
<para>molecule group. </para>
</entry>
                            </row>
                            <row>
                                <entry>t</entry>
                                <entry>
<para>rotation operation. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double RMSD. </para>
</formalpara>
</para>
<para>
Definition at line 31 of file mol_compare.cpp.</para>
</section>
</section>
</section>
