/** \page foxs_nup133 FoXS: fitting structures against SAXS data

\tableofcontents

\section foxs_nup133_intro Introduction

Nup133 is one of the proteins that make up the yeast
\salilab{npc,Nuclear Pore Complex (NPC)}. The structure of this protein has
been characterized by both X-ray crystallography and small angle X-ray (SAXS).
SAXS differs from X-ray crystallography in that it is applied to proteins in
solution rather than crystals; thus, it can be applied to a much wider range
of proteins in states more closely resembling their functional forms than
X-ray crystallography. Because the sample is in solution, the SAXS information
is rotationally averaged and so the resulting SAXS profile gives less
structural information than X-ray crystallography; however, this is often
sufficient to determine problems with the structure or to distinguish
possible conformations.

%IMP includes a command line tool <tt>foxs</tt> for handling SAXS profiles,
which will be demonstrated in this example.
There is also a \salilab{foxs/,web interface} available, which functions
similarly.

For full help on the <tt>foxs</tt> tool, run from a command line:

\code{.sh}
foxs -h
\endcode

\section foxs_nup133_setup Setup

First, obtain the input files used in this example and put them in the
current directory, by typing:

\code{.sh}
cp <imp_example_path>/foxs/nup133/* .
\endcode

(On a Windows machine, use `copy` rather than `cp`.) Here, `<imp_example_path>`
is the directory containing the %IMP example files. The full path to the files
can be determined by running in a Python interpreter '<tt>import IMP.foxs;
print(IMP.foxs.get_example_path('nup133'))</tt>'.

\section foxs_nup133_calc Calculation

The structure of the C-terminal domain of yeast Nup133 is available in the
\external{http://www.pdb.org,RCSB Protein Data Bank (PDB)} as code
\external{http://www.pdb.org/pdb/explore/explore.do?structureId=3KFO,3kfo}
(file <tt>3KFO.pdb</tt>), while the experimental SAXS profile is given in the
<tt>23922_merge.dat</tt> file. The atomic structure can be fit against the
SAXS profile by running FoXS:

\code{.sh}
foxs 3KFO.pdb 23922_merge.dat
\endcode

FoXS calculates the theoretical profile of the 3KFO structure and fits it
against the experimental profile, and determines the quality of the fit, Chi,
with smaller values corresponding to closer fits. It also generates two
<tt>.dat</tt> files, one containing the theoretical profile and the other
this profile fit against the experimental profile. These files can be input to
a plotting package (two \external{http://www.gnuplot.info/,gnuplot} input
files with a <tt>.plt</tt> extension are provided).

The fit in this example is not a good one (Chi=2.96). To understand why this
is so, the header of the 3KFO PDB file can be examined in a text editor.
This reveals two problems. Several residues at the N and C termini were not
resolved in the X-ray experiment (9 in total, 2 at the N terminus and 7 at the
C terminus), and the sidechains of 16 other residues could also not be located
(REMARK 465 and REMARK 470 lines). This problem can be resolved by adding in
the missing atoms and residues by using \salilab{modeller,MODELLER}, which
generated the <tt>3KFO-fill.B99990005.pdb</tt> file.

The fits of the original PDB and the new structure can now be generated by
running:

\code{.sh}
foxs -g 3KFO.pdb 3KFO-fill.B99990005.pdb 23922_merge.dat
\endcode

The output shows that the new structure has a significantly better fit
(Chi=1.15). FoXS generates a gnuplot input file <tt>fit.plt</tt> which will
plot the fits of all of the PDBs given against the profile. This can be
run with:

\code{.sh}
gnuplot fit.plt
\endcode

This generates an image, <tt>fit.png</tt>, showing the theoretical profiles
(lines in top panel), the experimental profile (points in top panel) and the
ratios of the experimental to theoretical profiles (bottom panel):

<img src="foxs_nup133.png" alt="FoXS plot of Nup133 and its SAXS profile" width="450px">

*/
