YARM samples:
Statistical analysis: entire molecule
Statistically compare the NOE volumes of a simulated data set from a Model
and an experimentally measured NOE volume data set. This script returns four
statistical value, RMS, R-factor, Q-factor and Q^(1/6)-factor, see the
Stats page for a description of the statistical
functions.
#!/usr/local/bin/perl
require "/usr/local/yarm/yarm_lib.pl";
################################################
# Define variables
################################################
$pdb_file = "dick_xtal.pdb";
$sfreq = 600;
$vol0 = 100;
$tmix = 0.2;
$tl = 2.5;
$ts = 6;
$tc = 3;
$f95_vol_file = "d12_30s.vols";
$f95_peak_file = "d12_30s.peaks";
# Set to 0 for no debugging messages
# Set to 1 for a few debugging messages
# set to 2 for TONS of debugging messages (lots!)
$debug = 0;
################################################
# Call YARM subroutines
################################################
print "$yarm_version\n";
# Get non-exchangeable nucleic acid protons from a PDB file
%xyz = &Pdb_Read_All( $pdb_file );
%xyz = &Get_Atom_Type( \%xyz, \%nonX_NA );
%xyz = &Pseudo_Methyl(\%xyz);
# Measure distances of all atom pairs between
# 0 to 10 angstroms
%rij = &Rij_Hash( \%xyz, 0, 10 );
# ANISOTROPIC ROTATION
# Calculate the principal axis of rotation vector
print "Simulating NOE volumes using anisotropic-rigid...\n";
( $Ax, $Ay, $Az ) = Principal_Axis( \%xyz );
printf ("Principal axis vector components Ax=%4.2f Ay=%4.2f Az=%4.2f\n", $Ax, $Ay, $Az);
%vol_sim = &Sim_Vol( $sfreq, $tmix, $vol0, \%xyz, \%rij, $tl, $ts, $Ax, $Ay, $Az );
# ISOTROPIC ROTATION
# print "Simulating NOE volumes using isotropic-rigid...\n";
# %vol_sim = &Sim_Vol( $sfreq, $tmix, $vol0, \%xyz, \%rij, $tc );
# Read in experimental volumes
%vol_exp = &F95_Read_Merge( $f95_vol_file, $f95_peak_file );
# Convert the experimental volumes to include segids A and B
# We have to do this b/c this DNA is a symmetric molecule
%vol_exp = &Make_Symm_Molecule( A, B, \%vol_exp );
# Normalize the experimental volumes to the simulated volumes
%vol_exp = &Norm_Hash( \%vol_exp, \%vol_sim );
# Calculate statistics between the experimental and simulated volume sets
( $rms, $r, $q, $q6 ) = &Stats( \%vol_exp, \%vol_sim );
################################################
# Print a nice report
################################################
# Print the final "report" rms value
print "Pairwise statistical analysis:\n";
printf (" RMS = %5.4f\n", $rms);
printf (" R-factor = %5.4f\n", $r);
printf (" Q-factor = %5.4f\n", $q);
printf ("Q^(1/6)-factor = %5.4f\n", $q6);