Difference between revisions of "X2spinach.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(→‎Arguments)
(rebuilt per IK instruction 2026-08-30: removed malformed duplicated preamble, standard function-page layout, schema-validation warning preserved as a Notes entry)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:x2spinach.m}} __NOTOC__
 
{{DISPLAYTITLE:x2spinach.m}} __NOTOC__
 +
Reads [[Appendix_G:_SpinXML_infrastructure|SpinXML]] files and forms Spinach data structures. The file is parsed into an XML tree; a first pass collects ''spin'' elements together with their isotopes, text labels and Cartesian coordinates and sorts them into sequential spin order, and a second pass collects ''interaction'' elements. Interaction tensors may be specified as a full matrix, an isotropic scalar, eigenvalues, isotropic part with anisotropy and asymmetry, span and skew, or axiality and rhombicity; the orientation may be supplied as Euler angles, a quaternion, a direction cosine matrix, or an angle-axis pair. Hyperfine, shielding, shift, dipolar, quadrupolar, J-coupling, g-tensor, zero-field splitting, exchange and spin-rotation interactions are recognised and converted into the units that Spinach expects.
  
−
Reads [[Appendix_G:_SpinXML_infrastructure|SpinXML]] files and forms Spinach data structures. Syntax:
+
==Syntax==
  
 
     [sys,inter]=x2spinach(filename,shielding_refs)
 
     [sys,inter]=x2spinach(filename,shielding_refs)
  
−
Parameters:
+
==Parameters==
  
 +
  filename      - SpinXML file name
 +
 
   shielding_refs - when absolute shielding is provided, this
 
   shielding_refs - when absolute shielding is provided, this
 
                     array must give absolute shielding of the
 
                     array must give absolute shielding of the
Line 13: Line 16:
 
                     This is necessary because Spinach requires
 
                     This is necessary because Spinach requires
 
                     chemical shifts rather than shieldings.
 
                     chemical shifts rather than shieldings.
 +
                    If chemical shifts are provided, use an
 +
                    empty cell array.
 +
 +
==Outputs==
  
 +
  sys, inter    - Spinach spin system input structures
 +
 +
==Notes==
 
'''WARNING''': this function assumes that the [[Appendix_G:_SpinXML_infrastructure|SpinXML]] file has passed the validation against the schema, which may be obtained from http://spindynamics.org/SpinXML.php
 
'''WARNING''': this function assumes that the [[Appendix_G:_SpinXML_infrastructure|SpinXML]] file has passed the validation against the schema, which may be obtained from http://spindynamics.org/SpinXML.php
  
−
==Arguments==
+
Spin and interaction identifiers must be numbered from 1; zero-base indexing is detected and rejected, and the spin id numbers must form a sequential list of integers.
  
−
  shielding_refs - when absolute shielding is provided, this
+
==See also==
−
                    array must give absolute shielding of the
+
[[parsexml.m]], [[gissmo2spinach.m]], [[c2spinach.m]], [[cyprinol.m]], [[fatty_acid.m]], [[g2spinach.m]], [[gparse.m]], [[karplus_fit.m]], [[killcross.m]], [[killdiag.m]], [[merge_inp.m]], [[methyl_group.m]], [[nuclacid.m]], [[ocparse.m]], [[oparse.m]], [[protein.m]], [[read_bmrb.m]], [[read_pdb_nuc.m]], [[read_pdb_pro.m]], [[v2spinach.m]], [[weblab2nqi.m]], [[Import,_export,_and_visualisation]], [[Appendix_G:_SpinXML_infrastructure]]
−
                    corresponding nuclei in the reference sub-
 
−
                    stance, e.g. {{'1H',31.5},{'13C',189.7}}.
 
−
                    This is necessary because Spinach requires
 
−
                    chemical shifts rather than shieldings.
 
−
                    If chemical shifts are provided, use an
 
−
                    empty cell array.
 
  
−
==See also==
+
''Version 2.11, authors: [[Ilya Kuprov]]''
−
[[parsexml.m]], [[gissmo2spinach.m]], [[c2spinach.m]], [[Appendix_G:_SpinXML_infrastructure|SpinXML infrastructure]]
 

Latest revision as of 10:18, 30 August 2026

Reads SpinXML files and forms Spinach data structures. The file is parsed into an XML tree; a first pass collects spin elements together with their isotopes, text labels and Cartesian coordinates and sorts them into sequential spin order, and a second pass collects interaction elements. Interaction tensors may be specified as a full matrix, an isotropic scalar, eigenvalues, isotropic part with anisotropy and asymmetry, span and skew, or axiality and rhombicity; the orientation may be supplied as Euler angles, a quaternion, a direction cosine matrix, or an angle-axis pair. Hyperfine, shielding, shift, dipolar, quadrupolar, J-coupling, g-tensor, zero-field splitting, exchange and spin-rotation interactions are recognised and converted into the units that Spinach expects.

Syntax

    [sys,inter]=x2spinach(filename,shielding_refs)

Parameters

  filename       - SpinXML file name

  shielding_refs - when absolute shielding is provided, this
                   array must give absolute shielding of the
                   corresponding nuclei in the reference sub-
                   stance, e.g. {{'1H',31.5},{'13C',189.7}}.
                   This is necessary because Spinach requires
                   chemical shifts rather than shieldings.
                   If chemical shifts are provided, use an
                   empty cell array.

Outputs

  sys, inter     - Spinach spin system input structures

Notes

WARNING: this function assumes that the SpinXML file has passed the validation against the schema, which may be obtained from http://spindynamics.org/SpinXML.php

Spin and interaction identifiers must be numbered from 1; zero-base indexing is detected and rejected, and the spin id numbers must form a sequential list of integers.

See also

parsexml.m, gissmo2spinach.m, c2spinach.m, cyprinol.m, fatty_acid.m, g2spinach.m, gparse.m, karplus_fit.m, killcross.m, killdiag.m, merge_inp.m, methyl_group.m, nuclacid.m, ocparse.m, oparse.m, protein.m, read_bmrb.m, read_pdb_nuc.m, read_pdb_pro.m, v2spinach.m, weblab2nqi.m, Import,_export,_and_visualisation, Appendix_G:_SpinXML_infrastructure

Version 2.11, authors: Ilya Kuprov