Measure : 
<a href="#calcDiffPAS">calcDiffPAS</a> | 
<a href="#calcInertiaTensor">calcInertiaTensor</a> | 
<a href="#calcCenterMass">calcCenterMass</a> | 
<a href="#calcRij">calcRij</a> | 
<a href="#calcAngles">calcAngles</a><br>

Manipulate :
<a href="#symmMolecule">symmMolecule</a> | 
<a href="#removeElement">removeElement</a> | 
<a href="#getAtomType">getAtomType</a> | 
<a href="#addChainIds">addChainIds</a> | 
<a href="#replaceMethyls">replaceMethyls</a> | 
<a href="#fixRij">fixRij</a> | 
<a href="#refineStructure">refineStructure</a> | 
<a href="#xyz_2_Reference">xyz_2_Reference</a> | 
<p>

These subroutines that work with the structural elements 
of a coordinate (%xyz) hash.  The routines can be subdivided by whether
they "measure" some quantity concerning the structure or whether they
"manipulate" some parameter of the structure.
<p>
The measurement routines will always return some measured quantity (for 
example: &calcRij returns a 2D array containing the distances between 
the atoms of interest).  The manipulate routines will always return a 
1D structure array containing the "new" structure post-manipulation (for
example: &.... )

<p>

<!--------------------------------------------------------->
<a name="calcDiffPAS">
<hr>
<h4>calcDiffPAS</h4>
<b>Summary:</b><br>
Calculates the principal axis of diffusion of a structure
<p>

<b>Usage:</b><br>
( $Ax, $Ay, $Az ) = &calcDiffPAS( \%xyz ); <br>
or <br>
( $Ax, $Ay, $Az, @U ) = &calcDiffPAS( \%xyz );
<p>

<b>Description:</b><br>
Calculates the principal axis of diffusion of a structure
by calculating the inertia tensor.
<p>
@U is (optionally) returned, and is the eigenvectors of the Inertia 
Tensor
<p>

<b>Example:</b><br>

<!--------------------------------------------------------->
<a name="calcInertiaTensor">
<hr>
<h4>calcInertiaTensor</h4>
<b>Summary:</b><br>
Calculates the inertia tensor of a structure
<p>

<b>Usage:</b><br>
@inertia_tensor = &calcInertiaTensor( \%xyz );
<p>
<b>Description:</b><br>
<p>
<b>Example:</b><br>

<!--------------------------------------------------------->
<a name="calcCenterMass">
<hr>
<h4>calcCenterMass</h4>
<b>Summary:</b><br>
Calculates the centetr of mass of a structure
<p>

<b>Usage:</b><br>
( $ComX, $ComY, $ComZ ) = &CenterMass( \%xyz );
<p>

<b>Description:</b><br>
Calculate the center of mass of %xyz.
<p>

<b>Example:</b><br>

<!--------------------------------------------------------->
<a name="calcRij">
<hr>
<h4>calcRij</h4>
<b>Usage:</b><br>
%rij = &calcRij( \%xyz ); <br>
or <br>
%rij = &calcRij( \%xyz, $min, $max ); <p>

Returns distances between all atoms found in the coordinate hash %xyz.
Optionally, if $min and $max are supplied, only rij distances between
$min and $max will be returned.
<p>

<!--------------------------------------------------------->
<a name="calcAngles">
<hr>
<h4>calcAngles</h4>
<b>Summary:</b><br>
Calculate the angle between an arbitrary vector and the internuclear vectors
<p>

<b>Usage:</b><br>
%beta = &calcAngles( \%xyz, $Ax, $Ay, $Az );<br>
or<br>
%beta = &calcAngles( \%xyz, $Ax, $Ay, $Az, $min, $max );<br>
or<br>
%beta = &calcAngles( \%xyz, $Ax, $Ay, $Az, $min, $max, \%restriction_2d );<p>
<p>

<b>Description:</b><br>
Builds the beta angle hash (associative array).  The beta angle is 
the angle a vector in %xyz makes with respect to the vector $Ax $Ay $Az.
%restriction_2d is used as a reference 2D hash and determines which pairs
to return (often his is a %rij hash). $min and $max determine the minimum 
and maximum angle to return, they are optional, if left off, $min=0 and $max=90
<p>
<b>Example:</b><br>


<!--------------------------------------------------------->
<a name="symmMolecule">
<hr>
<h4>symmMolecule</h4>
<b>Summary:</b><br>
"Symmeterizes" a structure 2D input hash.
<p>

<b>Usage:</b><br>
%vol = &symmMolecule( "Segid1", "Segid2", \%vol );
<p>
<b>Description:</b><br>
<p>
Example:<p>

<!--------------------------------------------------------->
<a name="removeElement">
<hr>
<h4>&removeElement</h4>
<b>Summary:</b><br>
<p>

<b>Usage:</b><br>
%xyz = &removeElement( \%xyz, $element );
<p>

<b>Description:</b><br>
$element is one of C,H,N,O,P,S (or any other element).
<p>

<b>Example:</b><br>

<!--------------------------------------------------------->
<a name="getAtomType">
<hr>
<h4>&getAtomType</h4>
<b>Usage:</b><br>
%xyz = &Get_Atom_Type( \%xyz, \%ref_hash );
<p>

<!--------------------------------------------------------->
<a name="addChainIds">
<hr>
<h4>addChainIds</h4>
<b>Summary:</b><br>
<p>

<b>Usage:</b><br>
%vol = &addChainIds( "Segid1", "Segid2", $num1, $num2, \%vol );
<p>
<b>Description:</b><br>
<p>
<b>Example:</b><br>


<!--------------------------------------------------------->
<a name="replaceMethyls">
<hr>
<h4>replaceMethyl</h4>
<b>Summary:</b><br>

<b>Usage:</b><br>
%xyz = &replaceMethyl( \%xyz );<br>
or<br>
%xyz = &replaceMethyl( \%xyz, $atom1, $atom2, $atom3, $new_name );<p>
<p>

<b>Description:</b><br>
$atom1, $atom2, $atom3 = atom name 1, 2 and 3 of the methyl<br>
$new_name = New name of pseudo_methyl
<p>
<b>Example:</b><br>

<!--------------------------------------------------------->
<a name="fixRij">
<hr>
<h4>fixRij</h4>
<b>Summary:</b><br>
<p>

<b>Usage:</b><br>
%rij = &fixRij( \%rij, \%rij_fix );<br>
<p>
<b>Description:</b><br>
<p>
<b>Example:</b><br>

<!--------------------------------------------------------->
<a name="refineStructure">
<hr>
<h4>refineStructure</h4>
<b>Summary:</b><br>
<p>

<b>Usage:</b><br>
&refineStructure( \%YarmModel, \%NmrParams, \%exp_vols, $vol0, $tmix, $niters );
<p>

<b>Description:</b><br>
%exp_vols = experimentally measured NOE volumes<br>
$vol0 = volume of autopeaks at a tmix=0<br>
$tmix = NOE mixing time<br>
$niters = maximum number of conjugate gradient iterations<br>
<p>
This subroutine creates a file named "yarm_output.refine_xyz" that
contains the _new_ coordinate positions of the atoms from
%YarmModel that best fit the NOE volume data.
<p>
<b>Example:</b><br>



<!--------------------------------------------------------->
<a name="xyz_2_Reference">
<hr>
<h4>xyz_2_Reference</h4>
<b>Usage:</b><br>
@Frame = &xyz_2_References( $atom, $atom1, $atom2, \%xyz );
<p>
Calculate the reference frame of $atom using $atom1 and $atom2
to define a plane, using the following rules:

<p>
<pre>
rule 1 - define x-axis to be along the bond vector between the
	   site def and the first element of the corresponding list
	   within the plane def hash.  This element is found by vector
	   subtraction.

rule 2 - define y-axis to be the normal to the plane defined by the 
	   x-axis and the second element of the corresponding list within 
	   the plane def hash.  This element is found by computing the cross 
	   product between the vector defining the x-axis and the....
	   The cross-product is defined as the vector determinant of 
		   | i  j  k  |
		   | Ax Ay Az | = ( Cx, Cy, Cz )
		   | Bx By Bz |
	   where Cx = ( AyBz - AzBy ), Cy = -( AxBz - AzBx ), Cz = ( AxBy - AyBx )
	   Vector calculus if cool!  Hug a chemical physicist.

rule 3 - define z-axis to be the normal to the plane defined by the 
	   x-axis and the y-axis.  This element is found by computing the 
	   cross-product between the x-axis vector and the y-axis vector.
</pre>

