YARM: Yet Another Relaxation Matrix program
A program for performing nuclear spin relaxation calculations

Sections: Main | Using YARM | Subroutines | Theory | Samples | Resources
Subsections: Introduction | Relaxation | CSA | Structure | Data Fitting | Hydrodynamics | Interface | Utilities | System
Interface subroutines:
YARM: readData | writeData
PDB: readPdb | writePdb
Felix: readFelix
X-PLOR: readXplor | writeXplor | writeXplor2
Midas: viewMidas
NMRView: readXPK

These subroutines allow you to read/write in formats compatible with data exchange between YARM and other programs.


&readData

Summary:

Usage:
%data = &readData( $file );

Reads in arbitrary data files of this construct:
"A B C" : value1
or
"A B C" : value1 : value2
or
"A B C" : value1 : value2 : value3 : etc....


&writeData

Summary:

Usage:
&writeData( $file, \%data );

Writes out arbitrary data files of this construct:
"A B C" : value1
or
"A B C" : value1 : value2
or
"A B C" : value1 : value2 : value3 : etc....


&readPdb

Summary:
Reads in PDB files

Usage:
%xyz = &readPdb( $pdb_file );

Description:
      Opens a pdb structure file, record each atom name (key value) and the x,y and z coordinates (list value for the key) and the number of nuclei at this coordinate, n, (always 1).

In YARM, an atom is always "named" by 4 values:

   1) the segment identifier (or chainid)
   2) the residue number
   3) the residue name
   4) the atom name
      For example, the "C6" atom on chainid A, residue number 4, residue cytosine would be called "A 3 CYT C6" in YARM. A PDB file can be read into YARM via "Pdb_Read_All" command thusly: %xyz = &Pdb_Read_All( "dna.pdb" ); The 1D associavite array called %xyz contains all the atoms and their associated Cartesian orthogonal coordinates.
%pdb = {
	'chain res_num res atom' => [ x0 , y0 , z0, n0, isotope1, fract1, isotope2, fract2 ],
	'chain res_num res atom' => [ x1 , y1 , z1, n1, isotope1, fract1, isotope2, fract2 ], 
	etc...
}
      Thus, $pdb{"A 3 CYT C6"}[2] returns the z coordinate of the C6 atom of cytosine #4 on chainid A.

Notes:

1) The required data from a PDB file are "atom", "x", "y", and "z".
2) If no "chain" or "segid" is found in the PDB file, the "chain"
    will be assigned as A
3) If no "res" is found, it will be assigned as "A"
4) If no "res_num" is found, it will be assigned as "1"

The layout of a PDB file (note: counting from 0, not 1):

YARM name      column  length type    long name
-------------  ------  ------ ------  ------
rec            0-5     6      char    Record type
atom_num       6-10    5      int     Atom serial number
atom           12-15   4      char    Atom name
alt            16      1      char    Alternate location indicator
res            17-19   3      char    Residue name
chain          20      1      char    Chain identifier
res_num        22-25   4      int     Residue sequence number
inserts        26      1      char    Code for insertion of residues
x              30-37   8      float   X orthogonal coordinate (Angs)
y              38-45   8      float   Y orthogonal coordinate (Angs)
z              46-53   8      float   Z orthogonal coordinate (Angs)
occ            54-59   6      float   Occupancy
temp           60-65   6      float   Temperature factor
segid          72-74   4      float   Segment identifier (from X-PLOR)

Example:


&writePdb

Summary:
Reads in PDB files

Usage:
&writePdb( \%xyz, $pdb_file );
or
&writePdb( \%xyz, $pdb_file, "a", first_atom_num );

Description:
Use "a" to append rather then overwrite to pdb file.

$first_atom_num = the first number to begin counting from


&readFelix

Summary:
Reads in Felix files

Usage:
%data = &readFelix( "shifts", $version, $peak_file );
or
%data = &readFelix( "data", $version, $peak_file, $data_file );

Description:
$version => 95 or 97 is the Felix version

Example:


&writeXplor

Summary:

Usage:
&writeXplor( \%rij, \%ref_hash, $min, $max, $file );

Description:
X-PLOR (restrained molecular dynamics) interface. Writes out a file in the XPLOR distance file format from the supplied %rij hash. The distance range is determined from the $min and $max variables.

Example:


&writeXplor2

Summary:

Usage:
&writeXplor2( \%rij, \%ref_hash, $file );

Description:
X-PLOR (restrained molecular dynamics) interface. Writes out a file in the XPLOR distance file format from the supplied %rij hash. The distance range is given by the following formula:

rij <3  min=0.1 max=0.1
rij <4  min=0.2 max=0.2
rij <5  min=0.3 max=0.3
rij <6  min=0.4 max=0.4
rij >=6 min=0.5 max=0.5

Example:


&readXplor

Summary:
Reads an XPLOR restraint file into a 2D data hash

Usage:
%rij = &readXplor( $xplor_file, \%ref_hash );

Description:


&viewMidas

Usage:
&viewMidas( $pdb_file );

Displays a pdb file using the Midas program from UCSC.


&readXPK

Summary:
Usage:
%hash = &readXPS( $xpk_file );
or
%hash = &readXPS( $xpk_file, $oatom );
or
%hash = &readXPS( $xpk_file, $oatom, $olist );

Description:
This subroutine parses and NMRView .xpk file for valuable information such as cross-peak assignments, chemical shift assignments, cross-peak volume measurements, and cross-intensity measurements. All numbers are returned as list entries in a 2-D hash references by the cross-peak assignments. This subroutine is upgradeable to select for more information in the .xpk file

$oatom = "usei"  => return a 1D hash with iatoms as keys
$oatom = "usej"  => return a 1D hash with jatoms as keys
$oatom = "useij" => return a 2D hash with iatoms and jatoms as 
					 keys (default)

$olist = "all"  => return an array of (cs, int, vol) (default)
$olist = "cs", "int, "vol"  => return the Chemical shift, intensity, 
         or volume data.

Example: