Package csb :: Package bio :: Package io :: Module cs :: Class ChemShiftReader

[frames] | no frames]

# Class ChemShiftReader

source code

    object --+
             |
            ChemShiftReader

Known Subclasses:
  - ChemShift3Reader

Simple NMR STAR v2 chemical shift reader.

Note: This is not a full-fledged, semantic NMR STAR parser. It handles only the chemical shift table.

Instance Methods

__init__(self, frame=`'``save_assigned_chemical_shifts``'`) x.__init__(...) initializes x; see help(type(x)) for signature | source code

tuple of ChemShiftInfo

read_file(self, filename) Parse the specified file. | source code

tuple of ChemShiftInfo

read_shifts(self, star_table) Parse a given NMR STAR chemical shift table. | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Static Methods

ChemShiftReader

create(frame=`'``save_assigned_chemical_shifts``'`, version=2) Parser factory: create a new parser, given a saveframe name and format verison. | source code

ChemShiftReader

guess(file, frame=`'``save_assigned_chemical_shifts``'`) Parser factory: try to guess the correct NMR STAR version from a given file and create an appropriate parser. | source code

Class Variables
| ATOM = ``'``_Atom_name``'``
| ELEMENT = ``'``_Atom_type``'``
| FRAME = ``'``save_assigned_chemical_shifts``'``
| RANK = ``'``_Residue_seq_code``'``
| RESIDUE = ``'``_Residue_label``'``
| SHIFT = ``'``_Chem_shift_value``'``

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, frame=`'``save_assigned_chemical_shifts``'`)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
  (inherited documentation)

### create(frame=`'``save_assigned_chemical_shifts``'`, version=2)
Static Method

source code

Parser factory: create a new parser, given a saveframe name and format verison.

Parameters:
  - `frame` (str) - name of the saveframe to read
  - `version` (int) - NMR STAR format version
Returns: ChemShiftReader
  an instance of any ChemShiftReader class

### guess(file, frame=`'``save_assigned_chemical_shifts``'`)
Static Method

source code

Parser factory: try to guess the correct NMR STAR version from a given file and create an appropriate parser.

Parameters:
  - `file` (str) - NMR STAR path and file name
  - `frame` (str) - name of the saveframe to read
Returns: ChemShiftReader
  an instance of any ChemShiftReader class
Raises:
  - `ChemShiftFormatError` - on failure to determine the NMR STAR version

### read_file(self, filename)

source code

Parse the specified file.

Parameters:
  - `filename` (str) - file path and name
Returns: tuple of ChemShiftInfo

### read_shifts(self, star_table)

source code

Parse a given NMR STAR chemical shift table.

Parameters:
  - `star_table` (str) - NMR STAR chemical shift table
Returns: tuple of ChemShiftInfo
Raises:
  - `ChemShiftFormatError` - on parse error