Miscellaneous functionality

From Spinach Documentation Wiki
Revision as of 03:14, 8 August 2016 by Admin (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This section contains description of functions that do not properly belong to any of the above categories. They have been placed in the /etc directory. In particular, this directory contains data import and export functionality. Due to the abundance of legacy formats, conflicting literature conventions and other manifestations of the long and glorious history of magnetic resonance spectroscopy, the code in some functions can be quite obscure.

cst_display.m – visualizes chemical shielding tensors and their eigensystems. Takes the props structure from the output of gparse function. Every ellipsoid is drawn in the following way:

1. A unit sphere in a Cartesian space is scaled by abs(Axx) in the x direction, abs(Ayy) in the y direction and abs(Azz) in the z direction, where Axx, Ayy, Azz are the eigenvalues of the CST tensor in units of ppm. 2. A set of axes is drawn inside the sphere with red axis for positive eigenvalues and blue for negative ones. 3. The sphere is translated to the point of corresponding atom and rotated into the molecular frame.

Syntax:

    cst_display(props,atoms,scaling_factor,conmatrix)

Arguments: props - output of gparse function; atoms - a cell array of element symbols, indicating the atoms for which the shielding tensors should be visualized; scaling_factor - a factor to scale the tensors by for visualization; conmatrix - binary connectivity matrix, 1 if a pair of atoms should be connected by a bond in the resulting plot. Note: software OpenGL is set as default, switch to hardware on systems with good hardware graphics. Note: antisymmetric components of the shielding tensors are ignored. Shielding values are computed relative to the bare nucleus in vacuum.

destreak.m – Reduces streak artefacts in 2D and 3D NMR spectra. Edges of the input spectrum must be free of genuine signals. Syntax:

    spectrum=destreak(spectrum)

Cell arrays and structures are processed recursively.

fid2ascii.m – Writes out 1D, 2D and 3D free induction decays generated by Spinach as ASCII files in the following format [time1, time2, time3, real, imag]. Syntax:

    fid2ascii(filename,fid)

Time is printed in seconds.

gparse.m – a parser for Gaussian03 and Gaussian09 calculation logs. Extracts all potentially useful information. See Section 2.i for further information. Syntax:

    props=gparse(filename,options)

At the time of writing, importing a Gaussian log is one of the easiest ways of setting up very complicated and interaction-rich systems for simulation.

g2spinach.m – forms Spinach data structures from Gaussian parsing output. See Section 2.i for further information. Syntax:

    [sys,inter]=g2spinach(props,nuclei,references,options)

At the time of writing, importing a Gaussian log is one of the easiest ways of setting up very complicated and interaction-rich systems for simulation.

hfc_display.m – visualizes hyperfine coupling tensors and their eigensystems. Takes the props structure from the output of gparse function. Every ellipsoid is drawn in the following way:

1. A unit sphere in a Cartesian space is scaled by abs(Axx) in the x direction, abs(Ayy) in the y direction and abs(Azz) in the z direction, where Axx, Ayy, Azz are the eigenvalues of the CST tensor in units of ppm. 2. A set of axes is drawn inside the sphere with red axis for positive eigenvalues and blue for negative ones. 3. The sphere is translated to the point of corresponding atom and rotated into the molecular frame.

Syntax:

    hfc_display(props,atoms,scaling_factor,conmatrix)

Arguments: props - output of gparse function; atoms - a cell array of element symbols, indicating the atoms for which the shielding tensors should be visualized; scaling_factor - a factor to scale the tensors by for visualization; conmatrix - binary connectivity matrix, 1 if a pair of atoms should be connected by a bond in the resulting plot. Note: software OpenGL is set as default, switch to hardware on systems with good hardware graphics.

karplus_fit.m – performs Karplus coefficient estimation from a Gaussian J-coupling scan. Syntax:

    [A,B,C]=karplus_fit(dirname,atoms)

where dirname is the name of the directory containing several Gaussian magnetic property logs that differ only in the value of a specific dihedral angle in the molecular geometry. The atoms argument is a vector of four integers specifying the atoms that make up the dihedral angle. See karplus_extract.m file in examples/nmr_proteins directory for an example of how this function operates.

protein.m – protein data import. Parses PDB and BMRB data, runs a J-coupling guess, a CSA guess and outputs Spinach data structures. Syntax:

    [sys,inter]=protein(pdb_file,bmrb_file,subset)

Parameters: pdb_file - string containing the name of the PDB file, bmrb_file - string containing the name of the BMRB file, subset='backbone' imports protein backbone up to CB and HB, subset='backbone-minimal' only imports the backbone, subset='backbone-hsqc' is the same as subset=’backbone’, but with GLN and ASN side chain amide groups included, subset='all' imports everything that is assigned in BMRB. If a list of numbers is supplied, spins with those numbers in the PDB file are imported, but only if they are assigned in the PDB.

Note: unassigned atom coordinates are used internally for the J-coupling prediction procedure, but these atoms are not passed to Spinach.

Note: watch carefully the output of this function, it would inform you if it has to skip an atom or a coupling for any reason. More information is available in the protein HOWTO manual.

s2spinach.m – reads SIMPSON spin system specification and converts it into Spinach format. Syntax:

    [sys,inter]=s2spinach(filename)

only sys{} section of Simpson input is read and parsed.

strychnine.m – returns Spinach input structures for the spin system of strychnine, which is often a good testing case for NMR pulse sequence development. Syntax:

    [sys,inter]=strychnine(spins)

where spins parameter is a cell array containing the isotopes to import, e.g. {'1H','13C'}. Note: 13C-13C J-couplings are not provided – the specification is only suitable for natural abundance 13C simulations. CSA tensors are not provided either - relaxation theory treatments using this strychnine spin system would not account for CSA relaxation.

zfs_sampling.m - returns optimal ZFS distribution sampling information for Gd DOTA complexes.