<?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="_seq__align_8cpp">
<title>/Users/bernard/b20/bsoft/src/mol/seq_align.cpp File Reference</title>
<indexterm><primary>/Users/bernard/b20/bsoft/src/mol/seq_align.cpp</primary></indexterm>
<para>

<para>Library routines to generate and analyze dot plots. </para>
 
</para>
<programlisting>#include &quot;rwmolecule.h&quot;
#include &quot;rwresprop.h&quot;
#include &quot;dynamic_programming.h&quot;
#include &quot;seq_align.h&quot;
#include &quot;seq_util.h&quot;
#include &quot;linked_list.h&quot;
#include &quot;Matrix3.h&quot;
#include &quot;utilities.h&quot;
</programlisting><simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para>long <link linkend="_seq__align_8cpp_1a2b687e3ea2c31972088f3d7f1c0eb2fc">seq_pair_align</link> (<link linkend="_struct_bmolecule">Bmolecule</link> *mol1, <link linkend="_struct_bmolecule">Bmolecule</link> *mol2, double gapopen, double gapextend, <link linkend="_struct_bresidue__matrix">Bresidue_matrix</link> *simat)</para>

<para>Aligns two sequences. </para>
</listitem>
            <listitem><para>int <link linkend="_seq__align_8cpp_1afba94cefe678dc10ec0a08f3050b717d">seq_find_best_offset</link> (<link linkend="_struct_bmolecule">Bmolecule</link> *mol1, <link linkend="_struct_bmolecule">Bmolecule</link> *mol2, long &amp;nres, <link linkend="_struct_bresidue__matrix">Bresidue_matrix</link> *simat)</para>

<para>Finds the best offset for aligning two sequences without gaps. </para>
</listitem>
            <listitem><para><link linkend="_class_matrix">Matrix</link> <link linkend="_seq__align_8cpp_1a12fbf8da2ba3aef369d350568cc58b10">seq_dot_plot</link> (<link linkend="_struct_bmolecule">Bmolecule</link> *mol1, <link linkend="_struct_bmolecule">Bmolecule</link> *mol2, <link linkend="_struct_bresidue__matrix">Bresidue_matrix</link> *simat)</para>

<para>Calculates a dot plot for two sequences. </para>
</listitem>
            <listitem><para><link linkend="_class_matrix">Matrix</link> <link linkend="_seq__align_8cpp_1a8219aac6c1793f5c0c3738f73d568f41">seq_dot_plot_mov_avg</link> (<link linkend="_class_matrix">Matrix</link> dot_plot, int window)</para>

<para>Calculates a moving average along the diagonals of a dot plot. </para>
</listitem>
            <listitem><para>int <link linkend="_seq__align_8cpp_1a069b977df85bd1b07bae7214748407ce">seq_dot_plot_interpret</link> (<link linkend="_class_matrix">Matrix</link> dot_plot)</para>

<para>Finds the row and column maxima in a dot plot. </para>
</listitem>
            <listitem><para>double <link linkend="_seq__align_8cpp_1a7f87e39ee02d79deb1d57ff43a4e34dd">seq_dot_plot_best_segments</link> (<link linkend="_class_matrix">Matrix</link> dot_plot)</para>

<para>Finding the best segments in a dot plot. </para>
</listitem>
            <listitem><para>int <link linkend="_seq__align_8cpp_1a643f58168bd7544aa78477f5129d7755">seq_show_segments</link> (<link linkend="_struct_bmolecule">Bmolecule</link> *mol1, <link linkend="_struct_bmolecule">Bmolecule</link> *mol2, double threshold, <link linkend="_class_matrix">Matrix</link> dot_plot)</para>

<para>Finds the best offset for aligning two sequences without gaps. </para>
</listitem>
        </itemizedlist>
</simplesect>
<simplesect>
    <title>Variables    </title>
        <itemizedlist>
            <listitem><para>int <link linkend="_seq__align_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453">verbose</link></para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Library routines to generate and analyze dot plots. </para>

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

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

<para>Created: 20001029 </para>

<para>Modified: 20180622 </para>
</formalpara>
</para>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_seq__align_8cpp_1a12fbf8da2ba3aef369d350568cc58b10"/>    <section>
    <title>seq_dot_plot()</title>
<indexterm><primary>seq_dot_plot</primary><secondary>seq_align.cpp</secondary></indexterm>
<indexterm><primary>seq_align.cpp</primary><secondary>seq_dot_plot</secondary></indexterm>
<para><computeroutput><link linkend="_class_matrix">Matrix</link> seq_dot_plot (<link linkend="_struct_bmolecule">Bmolecule</link> * mol1, <link linkend="_struct_bmolecule">Bmolecule</link> * mol2, <link linkend="_struct_bresidue__matrix">Bresidue_matrix</link> * simat)</computeroutput></para><para>

<para>Calculates a dot plot for two sequences. </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 structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mol2</entry>
                                <entry>
<para>second molecule structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*simat</entry>
                                <entry>
<para>residue similarity matrix. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_matrix">Matrix</link> matrix with dot plot. </para>
</formalpara>
</para>
<para>
Definition at line 137 of file seq_align.cpp.</para>
    </section><anchor xml:id="_seq__align_8cpp_1a7f87e39ee02d79deb1d57ff43a4e34dd"/>    <section>
    <title>seq_dot_plot_best_segments()</title>
<indexterm><primary>seq_dot_plot_best_segments</primary><secondary>seq_align.cpp</secondary></indexterm>
<indexterm><primary>seq_align.cpp</primary><secondary>seq_dot_plot_best_segments</secondary></indexterm>
<para><computeroutput>double seq_dot_plot_best_segments (<link linkend="_class_matrix">Matrix</link> dot_plot)</computeroutput></para><para>

<para>Finding the best segments in a dot plot. </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>dot_plot</entry>
                                <entry>
<para>dot plot matrix. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double threshold to identify unique segments. </para>
</formalpara>
</para>
<para>
Definition at line 265 of file seq_align.cpp.</para>
    </section><anchor xml:id="_seq__align_8cpp_1a069b977df85bd1b07bae7214748407ce"/>    <section>
    <title>seq_dot_plot_interpret()</title>
<indexterm><primary>seq_dot_plot_interpret</primary><secondary>seq_align.cpp</secondary></indexterm>
<indexterm><primary>seq_align.cpp</primary><secondary>seq_dot_plot_interpret</secondary></indexterm>
<para><computeroutput>int seq_dot_plot_interpret (<link linkend="_class_matrix">Matrix</link> dot_plot)</computeroutput></para><para>

<para>Finds the row and column maxima in a dot plot. </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>dot_plot</entry>
                                <entry>
<para>dot plot matrix. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int number of maxima in both rows and columns. </para>
</formalpara>
</para>
<para>
Definition at line 214 of file seq_align.cpp.</para>
    </section><anchor xml:id="_seq__align_8cpp_1a8219aac6c1793f5c0c3738f73d568f41"/>    <section>
    <title>seq_dot_plot_mov_avg()</title>
<indexterm><primary>seq_dot_plot_mov_avg</primary><secondary>seq_align.cpp</secondary></indexterm>
<indexterm><primary>seq_align.cpp</primary><secondary>seq_dot_plot_mov_avg</secondary></indexterm>
<para><computeroutput><link linkend="_class_matrix">Matrix</link> seq_dot_plot_mov_avg (<link linkend="_class_matrix">Matrix</link> dot_plot, int window)</computeroutput></para><para>

<para>Calculates a moving average along the diagonals of a dot plot. </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>dot_plot</entry>
                                <entry>
<para>dot plot matrix. </para>
</entry>
                            </row>
                            <row>
                                <entry>window</entry>
                                <entry>
<para>moving average window size. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_matrix">Matrix</link> matrix with moving average dot plot. </para>
</formalpara>
</para>
<para>
Definition at line 168 of file seq_align.cpp.</para>
    </section><anchor xml:id="_seq__align_8cpp_1afba94cefe678dc10ec0a08f3050b717d"/>    <section>
    <title>seq_find_best_offset()</title>
<indexterm><primary>seq_find_best_offset</primary><secondary>seq_align.cpp</secondary></indexterm>
<indexterm><primary>seq_align.cpp</primary><secondary>seq_find_best_offset</secondary></indexterm>
<para><computeroutput>int seq_find_best_offset (<link linkend="_struct_bmolecule">Bmolecule</link> * mol1, <link linkend="_struct_bmolecule">Bmolecule</link> * mol2, long &amp; nres, <link linkend="_struct_bresidue__matrix">Bresidue_matrix</link> * simat)</computeroutput></para><para>

<para>Finds the best offset for aligning two sequences without gaps. </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 structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mol2</entry>
                                <entry>
<para>second molecule structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*nres</entry>
                                <entry>
<para>number of similar residues in best diagonal. </para>
</entry>
                            </row>
                            <row>
                                <entry>*simat</entry>
                                <entry>
<para>residue similarity matrix. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int the offset of sequence 2 with respect to sequence 1. <literallayout><computeroutput>The best offset is determined as the diagonal of a dot plot with
the highest value.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 94 of file seq_align.cpp.</para>
    </section><anchor xml:id="_seq__align_8cpp_1a2b687e3ea2c31972088f3d7f1c0eb2fc"/>    <section>
    <title>seq_pair_align()</title>
<indexterm><primary>seq_pair_align</primary><secondary>seq_align.cpp</secondary></indexterm>
<indexterm><primary>seq_align.cpp</primary><secondary>seq_pair_align</secondary></indexterm>
<para><computeroutput>long seq_pair_align (<link linkend="_struct_bmolecule">Bmolecule</link> * mol1, <link linkend="_struct_bmolecule">Bmolecule</link> * mol2, double gapopen, double gapextend, <link linkend="_struct_bresidue__matrix">Bresidue_matrix</link> * simat)</computeroutput></para><para>

<para>Aligns two sequences. </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 structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mol2</entry>
                                <entry>
<para>second molecule structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>gapopen</entry>
                                <entry>
<para>gap opening penalty. </para>
</entry>
                            </row>
                            <row>
                                <entry>gapextend</entry>
                                <entry>
<para>gap extension penalty. </para>
</entry>
                            </row>
                            <row>
                                <entry>*simat</entry>
                                <entry>
<para>residue similarity matrix. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long length of the aligned sequences. <literallayout><computeroutput>Two sequences are aligned and returned in the sequence strings
of the molecule structures.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 34 of file seq_align.cpp.</para>
    </section><anchor xml:id="_seq__align_8cpp_1a643f58168bd7544aa78477f5129d7755"/>    <section>
    <title>seq_show_segments()</title>
<indexterm><primary>seq_show_segments</primary><secondary>seq_align.cpp</secondary></indexterm>
<indexterm><primary>seq_align.cpp</primary><secondary>seq_show_segments</secondary></indexterm>
<para><computeroutput>int seq_show_segments (<link linkend="_struct_bmolecule">Bmolecule</link> * mol1, <link linkend="_struct_bmolecule">Bmolecule</link> * mol2, double threshold, <link linkend="_class_matrix">Matrix</link> dot_plot)</computeroutput></para><para>

<para>Finds the best offset for aligning two sequences without gaps. </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 structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mol2</entry>
                                <entry>
<para>second molecule structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>threshold</entry>
                                <entry>
<para>threshold to identify segments. </para>
</entry>
                            </row>
                            <row>
                                <entry>dot_plot</entry>
                                <entry>
<para>dot plot. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int the offset of sequence 2 with respect to sequence 1. <literallayout><computeroutput>The best offset is determined as the diagonal of a dot plot with
the highest value.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 324 of file seq_align.cpp.</para>
</section>
</section>
<section>
<title>Variable Documentation</title>
<anchor xml:id="_seq__align_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453"/>    <section>
    <title>verbose</title>
<indexterm><primary>verbose</primary><secondary>seq_align.cpp</secondary></indexterm>
<indexterm><primary>seq_align.cpp</primary><secondary>verbose</secondary></indexterm>
<para><computeroutput>int verbose</computeroutput></para></section>
</section>
</section>
