<?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="_molecule__to__map_8h">
<title>/Users/bernard/b20/bsoft/include/molecule_to_map.h File Reference</title>
<indexterm><primary>/Users/bernard/b20/bsoft/include/molecule_to_map.h</primary></indexterm>
<para>

<para>Header file for functions to calculate a 3D map from atomic coordinates. </para>
 
</para>
<programlisting>#include &quot;rwmolecule.h&quot;
#include &quot;rwimg.h&quot;
#include &quot;rwatomprop.h&quot;
#include &quot;symmetry.h&quot;
</programlisting><simplesect>
    <title>Macros    </title>
        <itemizedlist>
            <listitem><para>#define <link linkend="_molecule__to__map_8h_1a4587c515cc98fd4c028bc5ffc76e7d57">POTPREFAC</link>   47.87801</para>
</listitem>
        </itemizedlist>
</simplesect>
<simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para><link linkend="_class_bimage">Bimage</link> * <link linkend="_molecule__to__map_8h_1acad5f5feac3638b86371b0f908ca807a">img_from_molecule</link> (<link linkend="_struct_bmolgroup">Bmolgroup</link> *molgroup, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; size, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; sam, double resolution, double Bfactor, int wrap, int gextype, int spacegroup, <link linkend="_class_unit_cell">UnitCell</link> unit_cell)</para>

<para>Calculates a 3D density map from a set of atomic coordinates. </para>
</listitem>
            <listitem><para>int <link linkend="_molecule__to__map_8h_1a39f599018f385b21c83cf4c36ba624db">compare_mol_map</link> (<link linkend="_struct_bmolgroup">Bmolgroup</link> *molgroup, <link linkend="_class_bimage">Bimage</link> *pcalc, <link linkend="_class_bimage">Bimage</link> *pimg)</para>

<para>Compares reference and calculated maps and calculates an occupancy for every atom in the molecule set. </para>
</listitem>
            <listitem><para><link linkend="_class_bimage">Bimage</link> * <link linkend="_molecule__to__map_8h_1ad3eb6d5fac149f28f88a468576584234">img_sf_from_molecule</link> (<link linkend="_struct_bmolgroup">Bmolgroup</link> *molgroup, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; size, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; sam, double resolution, int spacegroup, <link linkend="_class_unit_cell">UnitCell</link> unit_cell, int wrap, double Bfactor, <link linkend="_class_bstring">Bstring</link> &amp;paramfile)</para>

<para>Calculates a 3D set of structure factors from a set of atomic coordinates. </para>
</listitem>
            <listitem><para>double * <link linkend="_molecule__to__map_8h_1a3ffe103357ed07d21bf9a68bb963db70">get_potential_curves</link> (<link linkend="_struct_batomtype">Batomtype</link> *atompar, double interval)</para>
</listitem>
            <listitem><para>double * <link linkend="_molecule__to__map_8h_1a556567729af00947e21caf11ac9590d3">get_scattering_curves</link> (<link linkend="_struct_batomtype">Batomtype</link> *atompar, double Bfactor, double recip_interval, long &amp;nscat)</para>
</listitem>
            <listitem><para>int <link linkend="_molecule__to__map_8h_1a96a78513215696f59337cc56eb92f911">write_scattering_curves</link> (<link linkend="_class_bstring">Bstring</link> &amp;paramfile, <link linkend="_class_bstring">Bstring</link> &amp;outfile, <link linkend="_class_bstring">Bstring</link> &amp;selection)</para>

<para>Calculates and writes atomic scattering profiles to a file. </para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Header file for functions to calculate a 3D map from atomic coordinates. </para>

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

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

<para>Created: 19970914 </para>

<para>Modified: 20150128 </para>
</formalpara>
</para>
</section>
<section>
<title>Macro Definition Documentation</title>
<anchor xml:id="_molecule__to__map_8h_1a4587c515cc98fd4c028bc5ffc76e7d57"/>    <section>
    <title>POTPREFAC</title>
<indexterm><primary>POTPREFAC</primary><secondary>molecule_to_map.h</secondary></indexterm>
<indexterm><primary>molecule_to_map.h</primary><secondary>POTPREFAC</secondary></indexterm>
<para><computeroutput>#define POTPREFAC   47.87801</computeroutput></para><para>
Definition at line 14 of file molecule_to_map.h.</para>
</section>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_molecule__to__map_8h_1a39f599018f385b21c83cf4c36ba624db"/>    <section>
    <title>compare_mol_map()</title>
<indexterm><primary>compare_mol_map</primary><secondary>molecule_to_map.h</secondary></indexterm>
<indexterm><primary>molecule_to_map.h</primary><secondary>compare_mol_map</secondary></indexterm>
<para><computeroutput>int compare_mol_map (<link linkend="_struct_bmolgroup">Bmolgroup</link> * molgroup, <link linkend="_class_bimage">Bimage</link> * pcalc, <link linkend="_class_bimage">Bimage</link> * p)</computeroutput></para><para>

<para>Compares reference and calculated maps and calculates an occupancy for every atom in the molecule set. </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>set of molecules with atomic coordinates. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pcalc</entry>
                                <entry>
<para>map calculated from the set of molecules. </para>
</entry>
                            </row>
                            <row>
                                <entry>*p</entry>
                                <entry>
<para>reference map. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 277 of file molecule_to_map.cpp.</para>
    </section><anchor xml:id="_molecule__to__map_8h_1a3ffe103357ed07d21bf9a68bb963db70"/>    <section>
    <title>get_potential_curves()</title>
<indexterm><primary>get_potential_curves</primary><secondary>molecule_to_map.h</secondary></indexterm>
<indexterm><primary>molecule_to_map.h</primary><secondary>get_potential_curves</secondary></indexterm>
<para><computeroutput>double* get_potential_curves (<link linkend="_struct_batomtype">Batomtype</link> * atompar, double interval)</computeroutput></para><para>
Definition at line 658 of file molecule_to_map.cpp.</para>
    </section><anchor xml:id="_molecule__to__map_8h_1a556567729af00947e21caf11ac9590d3"/>    <section>
    <title>get_scattering_curves()</title>
<indexterm><primary>get_scattering_curves</primary><secondary>molecule_to_map.h</secondary></indexterm>
<indexterm><primary>molecule_to_map.h</primary><secondary>get_scattering_curves</secondary></indexterm>
<para><computeroutput>double* get_scattering_curves (<link linkend="_struct_batomtype">Batomtype</link> * atompar, double Bfactor, double recip_interval, long &amp; nscat)</computeroutput></para><para>
Definition at line 720 of file molecule_to_map.cpp.</para>
    </section><anchor xml:id="_molecule__to__map_8h_1acad5f5feac3638b86371b0f908ca807a"/>    <section>
    <title>img_from_molecule()</title>
<indexterm><primary>img_from_molecule</primary><secondary>molecule_to_map.h</secondary></indexterm>
<indexterm><primary>molecule_to_map.h</primary><secondary>img_from_molecule</secondary></indexterm>
<para><computeroutput><link linkend="_class_bimage">Bimage</link>* img_from_molecule (<link linkend="_struct_bmolgroup">Bmolgroup</link> * molgroup, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; size, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; sampling, double resolution, double Bfactor, int wrap, int gextype, int spacegroup, <link linkend="_class_unit_cell">UnitCell</link> unit_cell)</computeroutput></para><para>

<para>Calculates a 3D density map from a set of atomic coordinates. </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>set of molecules with atomic coordinates. </para>
</entry>
                            </row>
                            <row>
                                <entry>origin</entry>
                                <entry>
<para>3-valued origin vector (angstrom). </para>
</entry>
                            </row>
                            <row>
                                <entry>size</entry>
                                <entry>
<para>3-valued size vector (voxels). </para>
</entry>
                            </row>
                            <row>
                                <entry>sampling</entry>
                                <entry>
<para>sampling/voxel size (angstrom/voxel). </para>
</entry>
                            </row>
                            <row>
                                <entry>resolution</entry>
                                <entry>
<para>resolution (angstrom). </para>
</entry>
                            </row>
                            <row>
                                <entry>Bfactor</entry>
                                <entry>
<para>global B-factor to use, if 0, use individual atom B-factors </para>
</entry>
                            </row>
                            <row>
                                <entry>wrap</entry>
                                <entry>
<para>wrapping flag. </para>
</entry>
                            </row>
                            <row>
                                <entry>gextype</entry>
                                <entry>
<para>type of gaussian used: 0 = single, 1 = atomic potential </para>
</entry>
                            </row>
                            <row>
                                <entry>spacegroup</entry>
                                <entry>
<para>crystal space group. </para>
</entry>
                            </row>
                            <row>
                                <entry>unit_cell</entry>
                                <entry>
<para>6-valued vector of unit cell parameters. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Bimage* the new map. <literallayout><computeroutput>A 3D map is calculated from atomic coordinates by placing a gaussian
sphere at each set of atomic coordinates. The resolution is set as
twice the sigma coefficient of the gaussian function. The amplitude
of the gaussian function is set so that the total density calculated
equals the atomic mass. The resultant map therefore has the density
units of Dalton/voxel.
The statistics of the new image is calculated.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 53 of file molecule_to_map.cpp.</para>
    </section><anchor xml:id="_molecule__to__map_8h_1ad3eb6d5fac149f28f88a468576584234"/>    <section>
    <title>img_sf_from_molecule()</title>
<indexterm><primary>img_sf_from_molecule</primary><secondary>molecule_to_map.h</secondary></indexterm>
<indexterm><primary>molecule_to_map.h</primary><secondary>img_sf_from_molecule</secondary></indexterm>
<para><computeroutput><link linkend="_class_bimage">Bimage</link>* img_sf_from_molecule (<link linkend="_struct_bmolgroup">Bmolgroup</link> * molgroup, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; size, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; sampling, double resolution, int spacegroup, <link linkend="_class_unit_cell">UnitCell</link> unit_cell, int wrap, double Bfactor, <link linkend="_class_bstring">Bstring</link> &amp; paramfile)</computeroutput></para><para>

<para>Calculates a 3D set of structure factors from a set of atomic coordinates. </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>set of molecules with atomic coordinates. </para>
</entry>
                            </row>
                            <row>
                                <entry>origin</entry>
                                <entry>
<para>3-valued origin vector (voxels). </para>
</entry>
                            </row>
                            <row>
                                <entry>size</entry>
                                <entry>
<para>3-valued size vector (voxels). </para>
</entry>
                            </row>
                            <row>
                                <entry>sampling</entry>
                                <entry>
<para>sampling/voxel size (angstrom/voxel). </para>
</entry>
                            </row>
                            <row>
                                <entry>resolution</entry>
                                <entry>
<para>resolution (angstrom). </para>
</entry>
                            </row>
                            <row>
                                <entry>spacegroup</entry>
                                <entry>
<para>crystal space group. </para>
</entry>
                            </row>
                            <row>
                                <entry>unit_cell</entry>
                                <entry>
<para>6-valued vector of unit cell parameters. </para>
</entry>
                            </row>
                            <row>
                                <entry>wrap</entry>
                                <entry>
<para>0=cut atoms outside box, 1=wrap coordinates within unit cell. </para>
</entry>
                            </row>
                            <row>
                                <entry>Bfactor</entry>
                                <entry>
<para>constant for decay curve. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;paramfile</entry>
                                <entry>
<para>parameter file with scattering coefficients. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Bimage* the new structure factors. <literallayout><computeroutput>All structure factors within a given resolution are calculated from
all the selected atomic coordinates. The coordinates are fractionalized
to fit into the given size box. If the size of the box is not given,
it defaults to:
    x_size = (max(x_coor) - min(x_coor)) / x_sampling
The atomic scattering profiles are read from the STAR database as the
amplitudes and B-factors of reciprocal space gaussians. For each profile,
a lookup table is calculated to speed up further calculations.
The statistics of the new image is calculated.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 355 of file molecule_to_map.cpp.</para>
    </section><anchor xml:id="_molecule__to__map_8h_1a96a78513215696f59337cc56eb92f911"/>    <section>
    <title>write_scattering_curves()</title>
<indexterm><primary>write_scattering_curves</primary><secondary>molecule_to_map.h</secondary></indexterm>
<indexterm><primary>molecule_to_map.h</primary><secondary>write_scattering_curves</secondary></indexterm>
<para><computeroutput>int write_scattering_curves (<link linkend="_class_bstring">Bstring</link> &amp; paramfile, <link linkend="_class_bstring">Bstring</link> &amp; outfile, <link linkend="_class_bstring">Bstring</link> &amp; selection)</computeroutput></para><para>

<para>Calculates and writes atomic scattering profiles to a file. </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>&amp;paramfile</entry>
                                <entry>
<para>file with scattering coefficients. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;outfile</entry>
                                <entry>
<para>file to write curves to. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;selection</entry>
                                <entry>
<para>element selection. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. <literallayout><computeroutput>The scattering coefficients are obtained from an input parameter file.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 803 of file molecule_to_map.cpp.</para>
</section>
</section>
</section>
