
Sorting: 
<a href="#sortAtoms">sortAtoms</a><br>

Misc Math:
<a href="#normHash">normHash</a> | 
<a href="#calcAngle">calcAngle</a> | 
<a href="#calcStats">calcStats</a> | 
<a href="#calcStats1D">calcStats1D</a> | 
<a href="#calcStats2D">calcStats2D</a><br>

Misc:
<a href="#calcIsotope">calcIsotope</a> | 
<a href="#calcNmrActive">calcNmrActive</a> | 
<a href="#calcSubset">calcSubset</a> | 
<a href="#calcTrimMean">calcTrimMean</a> | 
<a href="#calcFixed_Rij">calcFixed_Rij</a> | 
<a href="#txyz_2_Diffusion">txyz_2_Diffusion</a> | 
<a href="#calcDate">calcDate</a><br>

<p>

These subroutines perform various miscellaneous utility functions.
<p>

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

<b>Usage:</b><br>
@atoms = &sortAtoms( \@atoms );
<p>

<b>Description:</b><br>
<p>

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

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

<b>Usage:</b><br>
%normed_hash1 = &normHash( \%hash1, \%hash2 );<br>
or<br>
%normed_hash1 = &normHash( \%hash1, \%hash2, \%ref_hash );<p>
<p>

<b>Description:</b><br>
Normalize all values in a 2D hash1 to those in 2D hash2 by
summing all common values and calculating a normalization factor. 
This normalization factor is then multiplied to each element in hash1 
and returned. If a 2D ref_hash is supplied, the summing process will 
only use those atom pairs (for instance, if you only want to use an 
H5-H6 pair)
<p>
<b>Example:</b><br>


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

<b>Usage:</b><br>
$angle = &calcAngle( $Ax, $Ay, $Az, $Bx, $By, $Bz );<p>
<p>

<b>Description:</b><br>
Calculate the angle between two vectors, $Ax, $Ay, $Az, 
$Bx, $By, $Bz. Only use this to calculate a few angles!!!  
If you need many, it is much faster to use Beta_Hash 
(which calls the C++ programs!)
<p>

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

<!--------------------------------------------------------->
<a name="calcStats">
<hr>
<h4>&calcStats</h4>
<b>Summary:</b><br>
Calculates the standard deviation, average, or sum of a input 
list of numbers
<p>

<b>Usage:</b><br>
$sd = &calcSDev( \@numbers, "sd" );
or <br>
( $sd, $avg, $sum ) = &calcSDev( \@numbers, "sd", "avg", "sum" );
<p>

<b>Description:</b><br>
Calculates the standard deviation of a input list of numbers.
Also returns the average value and sum of all input numbers, if
you want them.
<p>

<b>Example:</b><br>
<pre>
@list = ( 12, 10, 11.2, 4.5, 14, 10.01 );
$sd = &calcStats( \@list, "sd" );
print "sd=$sd\n";
</pre>
returns
<pre>
sd=3.20008593634608
</pre>

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

<b>Usage:</b><br>
( $rms, $r, $q, $q6 ) = &calcStats1D( \%hash1, \%hash2 );<br>
or <br>
( $rms, $r, $q, $q6 ) = &calcStats1D( \%hash1, \%hash2, \%ref );
<p>
<b>Description:</b><br>
See &calcStats_2D below for a description.  
<p>

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

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

<b>Usage:</b><br>
( $rms, $r, $q, $q6 ) = &calcStats2D( \%hash1, \%hash2 );<br>
or <br>
( $rms, $r, $q, $q6 ) = &calcStats2D( \%hash1, \%hash2, \%ref );
<p>

<b>Description:</b><br>
Calculates pairwise statistical analysis 
between the values of %hash1 and %hash2.  Optionally, if
%ref is supplied, the analysis between %hash1 and %hash2
will be restricted only to the atom pairs found in %ref,
this can be used to examine the statistics of a particular 
nucleotide, for instance.
<p>

Some of the returned statistics are only meaningful for 
NMR NOE volumes (i.e.: q^6 );
<p>

Supported statistics:<p>

Root Mean Square (rms):<br>
<IMG SRC="../imgs/rms.gif" WIDTH=276 HEIGHT=141>
<p>

R-factor (r):<br>
<IMG SRC="../imgs/r.gif" WIDTH=183 HEIGHT=95>
<p>

Q-factor (q):<br>
<IMG SRC="../imgs/q.gif" WIDTH=203 HEIGHT=95>
<p>

Q^(1/6)-factor (q6):<br>
<IMG SRC="../imgs/q6.gif" >
<p>
<b>Example:</b><br>

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

<b>Usage:</b><br>
$I = &Get_Isotope( "A 3 CYT H1'" );<br>
Returns the isotope number of the supplied atom.
<p>

<b>Description:</b><br>
<p>
<b>Example:</b><br>

<!--------------------------------------------------------->
<a name="calcNmrActive">
<hr>
<h4>&calcNmrActive</h4>
<b>Summary:</b><br>
Determine which nuclei in %YarmModel{xyz_pdb} are NMR active
<p>

<b>Usage:</b><br>
%xyz_nmr = &calcNmrActive( \%YarmModel );<br>
<p>

<b>Description:</b><br>
<p>

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

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

<b>Usage:</b><br>
%vol_keys = &calcSubset($i_identifier, $j_identifier, \%vol_exp_hash );<p>
<p>

<b>Description:</b><br>
Makes a new 2D hash from vol_exp with identifiers specified by
$i_identifier and $j_identifier
<p>

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

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

<b>Usage:</b><br>
$fixed_rij = &calcFixed_Rij( $atom_i, $atom_j );
<p>

<b>Description:</b><br>
<p>

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

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

<b>Usage:</b><br>
@D = &txyz_2_Diffusion( $txx, $tyy, $tzz, @U );
<p>

<b>Description:</b><br>
$txx, $tyy, $tzz = correlation times about the 3 principal
axes of the diffusion tensor, where Dxx=1/(6txx), etc...
<p>
@U are the unit vectors about which txx, tyy and tzz apply 
(this can be from the inertia tensor...?)
<p>

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

<!--------------------------------------------------------->
<a name="calcDate">
<hr>
<h4>&calcDate</h4>
<b>Summary:</b><br>
Returns the date in a usable format
<p>

<b>Usage:</b><br>
( $dayname, $monthname, $mday, $hour, $min, $year ) = &calcDate;
<p>

<b>Description:</b><br>
Returns the current time/date information
<p>

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

