Package lib :: Package software :: Module xplor
[hide private]
[frames] | no frames]

Module xplor

source code

Module containing functions for the parsing and creation of Xplor formatted files.

Functions [hide private]
str
__convert_to_id(string)
Convert the string into a relax atom id representation.
source code
list of lists of str, str, float, float
parse_noe_restraints(lines)
Parse and return the NOE restraints from the Xplor lines.
source code
str, str, float, float, float
first_parse(lines)
Generator function to parse and extract the 2 atom IDs and NOE info from the lines.
source code
str or list of str
second_parse(id)
Split up pseudoatoms.
source code
list of str
strip_comments(lines)
Remove all Xplor comments from the data.
source code
Variables [hide private]
  __package__ = 'lib.software'

Imports: search, RelaxError


Function Details [hide private]

__convert_to_id(string)

source code 

Convert the string into a relax atom id representation.

Parameters:
  • string (str) - The Xplor atom string.
Returns: str
The relax atom id.

parse_noe_restraints(lines)

source code 

Parse and return the NOE restraints from the Xplor lines.

Parameters:
  • lines (list of str) - The Xplor formatted file, or file fragment, split into lines.
Returns: list of lists of str, str, float, float
The NOE restraint list in the format of two atom identification strings (or list of str for pseudoatoms) and the lower and upper restraints.

first_parse(lines)

source code 

Generator function to parse and extract the 2 atom IDs and NOE info from the lines.

The first parse loops over and returns the data from assign statements, returning pseudo atoms as single strings. The second parse splits the pseudoatoms.

Parameters:
  • lines (list of str) - The Xplor formatted file, or file fragment, split into lines.
Returns: str, str, float, float, float
The 2 atom IDs, and NOE info (NOE, upper, and lower bounds).

second_parse(id)

source code 

Split up pseudoatoms.

Parameters:
  • id (str) - The Xplor atom id without outer brackets, i.e. a single atom or a list of atoms in the case of pseudoatoms.
Returns: str or list of str
For normal atoms, the id string is returned unmodified. For pseudoatoms, a list of strings, with brackets removed, is returned.

strip_comments(lines)

source code 

Remove all Xplor comments from the data.

Parameters:
  • lines (list of str) - The Xplor formatted file, or file fragment, split into lines.
Returns: list of str
The file data with all comments removed.