PPTs logo

Table Of Contents

The ParaData module - for storing paramagnetic data and spin coordinates

Introduction and notes

The ParaData module is a data paramagentic data type. It stores:

  • Spin type: The atom identifier for which the paramagnetic effect has been measured
  • Spin id: The residue number for which the above atom identifier corresponds to
  • Experimental value: The experimentally determined value of the paramagnetic effect
  • The spin coordinates: The x,y,z components for the spin for which the experimental value is measured

All this data is extracted from the input Numbat-like formatted file and PDB file.

Note

The most important step for succesful operation of pyParaTools is the correct preparation of the input Numbat-like and PDB files. Numbering and atom indentifiers must be consitent between the two files.

API Documentation, Usage Examples and Doctests

class ParaData.PCSData(spin_type, spin_id, exp_val, e_tol, s_coord, useFit=0)

Storage and access to experimental PCS data and associated coordinates

A PCS data container. Paramagnetic effect type will be pcs

Parameters:
  • spin_type – The spin type (atom identifier)
  • spin_id – The residue id (residue number for the given atom)
  • exp_val – The experimental value
  • e_tol – The experimental tolerance
  • s_coord – The coordinates of the spin
  • useFit – Use this experimental values in fit [OPTIONAL]

:type useFit : boolean

Example Usage/Doctests

>>> # This tests all getter/setter methods. As a result of inheritence
>>> # these tests should sufficiently cover the ParaData base class
>>> # the PCS and PRE classes. RDC will require some additional testing!
>>> import sys
>>> import os
>>> from numpy import *
>>> sys.path.append(os.path.abspath('.'))
>>> st   = 'HN'
>>> rid  = 2
>>> epcs = 1.03
>>> etol = 0.1
>>> cxyz = [1.003, 10.819, -11.530]
>>> cxyz = array(cxyz)
>>> dat = PCSData(st,rid,epcs,etol,cxyz)
>>> # Check
>>> dat.getCVal(), dat.getCoord()
(0.0, array([  1.003,  10.819, -11.53 ]))
>>> dat.getCoordx(), dat.getCoordy(), dat.getCoordz()
(1.0029999999999999, 10.819000000000001, -11.529999999999999)
>>> dat.getId(), dat.getName(), dat.getTol(),dat.getType(), dat.getVal()
(2, 'HN', 0.10000000000000001, 'pcs', 1.03)
>>> #Update, check
>>> dat.setCVal(6.73)
>>> ncxyz = -100.000, 0.000, 8.000
>>> ncxyz = array(ncxyz)
>>> dat.setCoord(ncxyz)
>>> dat.setId(98)
>>> dat.setName('C')
>>> dat.setTol(0.5)
>>> dat.setVal(6.73)
>>> # Check
>>> dat.getCVal(), dat.getCoord()
(6.7300000000000004, array([-100.,    0.,    8.]))
>>> dat.getCoordx(), dat.getCoordy(), dat.getCoordz()
(-100.0, 0.0, 8.0)
>>> dat.getId(), dat.getName(), dat.getTol(),dat.getType(), dat.getVal()
(98, 'C', 0.5, 'pcs', 6.7300000000000004)
getCVal()

Returns the calculated value assigned to this spin

Until a calculation by a Calcer, this value will be 0.0

getCoord()

Returns the coordinates (x,y,z) assigned to this spin

getCoordx()

Returns the x coordinate assigned to this spin

getCoordy()

Returns the y coordinate assigned to this spin

getCoordz()

Returns the z coordinate assigned to this spin

getId()

Returns the residue number assigned to this spin

getName()

Returns the spin type (atom identifier) assigned to this spin

getTol()

Returns the experimental tolerance assigned to this spin

getType()

Returns the paramagnetic type assigned to this spin

Can be: unknown, pcs, pre, or rdc

getUseFit()

Return the the useFit state

getVal()

Returns the experimental value assigned to this spin

setCVal(cval)

Sets the calculated value assigned to this spin

Parameters:
  • cval – The experimental value
setCoord(coord)

Update the coordinates of the spin

Parameters:
  • coord – The coordinates of the spin in a numpy array [x, y, z]
setCoordx(coord_x)

Update the x coordinate of the spin

Parameters:
  • coord_x – The x coordinate of the spin
setCoordy(coord_y)

Update the y coordinate of the spin

Parameters:
  • coord_y – The y coordinate of the spin
setCoordz(coord_z)

Update the z coordinate of the spin

Parameters:
  • coord_z – The z coordinate of the spin
setId(r_id)

Update the residue id

Parameters:
  • r_id – The residue id
setName(name)

Update the spin type

Parameters:
  • name – The atom type (atom identifier, must agree with PDB file)
setTol(tol)

Update the experimental tolerance

Parameters:
  • tol – The experimental tolerance
setUseFit(val)

Alter the useFit state, Only 0 (use) or 1 (do not use) are possible.

Parameters:
  • val – Toogle value (0, or 1)
setVal(val)

Update the experimental value

Parameters:
  • val – The experimental value
class ParaData.PREData(spin_type, spin_id, exp_val, e_tol, s_coord, useFit=0)

Storage and access to experimental PRE data and associated coordinates

A PRE data container. Paramagnetic effect type will be pre

Parameters:
  • spin_type – The spin type (atom identifier)
  • spin_id – The residue id (residue number for the given atom)
  • exp_val – The experimental value
  • e_tol – The experimental tolerance
  • s_coord – The coordinates of the spin
  • useFit – Use this experimental values in fit [OPTIONAL]

:type useFit : boolean

Example Usage/Doctests

>>> # For more comprehensive testing see PCSData
>>> import sys
>>> import os
>>> from numpy import *
>>> sys.path.append(os.path.abspath('.'))
>>> st   = 'C'
>>> rid  = 100
>>> epcs = 0.01
>>> etol = 0.03
>>> cxyz = [99.000, -100.819, -0.830]
>>> cxyz = array(cxyz)
>>> dat = PREData(st,rid,epcs,etol,cxyz)
>>> dat.getType() == 'pre'
True
getCVal()

Returns the calculated value assigned to this spin

Until a calculation by a Calcer, this value will be 0.0

getCoord()

Returns the coordinates (x,y,z) assigned to this spin

getCoordx()

Returns the x coordinate assigned to this spin

getCoordy()

Returns the y coordinate assigned to this spin

getCoordz()

Returns the z coordinate assigned to this spin

getId()

Returns the residue number assigned to this spin

getName()

Returns the spin type (atom identifier) assigned to this spin

getTol()

Returns the experimental tolerance assigned to this spin

getType()

Returns the paramagnetic type assigned to this spin

Can be: unknown, pcs, pre, or rdc

getUseFit()

Return the the useFit state

getVal()

Returns the experimental value assigned to this spin

setCVal(cval)

Sets the calculated value assigned to this spin

Parameters:
  • cval – The experimental value
setCoord(coord)

Update the coordinates of the spin

Parameters:
  • coord – The coordinates of the spin in a numpy array [x, y, z]
setCoordx(coord_x)

Update the x coordinate of the spin

Parameters:
  • coord_x – The x coordinate of the spin
setCoordy(coord_y)

Update the y coordinate of the spin

Parameters:
  • coord_y – The y coordinate of the spin
setCoordz(coord_z)

Update the z coordinate of the spin

Parameters:
  • coord_z – The z coordinate of the spin
setId(r_id)

Update the residue id

Parameters:
  • r_id – The residue id
setName(name)

Update the spin type

Parameters:
  • name – The atom type (atom identifier, must agree with PDB file)
setTol(tol)

Update the experimental tolerance

Parameters:
  • tol – The experimental tolerance
setUseFit(val)

Alter the useFit state, Only 0 (use) or 1 (do not use) are possible.

Parameters:
  • val – Toogle value (0, or 1)
setVal(val)

Update the experimental value

Parameters:
  • val – The experimental value
class ParaData.ParaData(spin_type, spin_id, exp_val, e_tol, s_coord, useFit=0)

Provides storage and access to experimental data and coordinates

Base class of paramagnetic data type. Paramagnetic effect type will be unknown

Parameters:
  • spin_type – The spin type (atom identifier)
  • spin_id – The residue id (residue number for the given atom)
  • exp_val – The experimental value
  • e_tol – The experimental tolerance
  • s_coord – The coordinates of the spin
  • useFit – Use this experimental value in fit [OPTIONAL]

:type useFit : boolean (0 = yes, 1 = no)

Example Usage/Doctests

>>> # For more comprehensive testing see PCSData
>>> import sys
>>> import os
>>> from numpy import *
>>> sys.path.append(os.path.abspath('.'))
>>> st   = 'C'
>>> rid  = 100
>>> epcs = 0.01
>>> etol = 0.03
>>> cxyz = [99.000, -100.819, -0.830]
>>> cxyz = array(cxyz)
>>> dat = ParaData(st,rid,epcs,etol,cxyz)
>>> dat.getType() == 'unknown'
True
getCVal()

Returns the calculated value assigned to this spin

Until a calculation by a Calcer, this value will be 0.0

getCoord()

Returns the coordinates (x,y,z) assigned to this spin

getCoordx()

Returns the x coordinate assigned to this spin

getCoordy()

Returns the y coordinate assigned to this spin

getCoordz()

Returns the z coordinate assigned to this spin

getId()

Returns the residue number assigned to this spin

getName()

Returns the spin type (atom identifier) assigned to this spin

getTol()

Returns the experimental tolerance assigned to this spin

getType()

Returns the paramagnetic type assigned to this spin

Can be: unknown, pcs, pre, or rdc

getUseFit()

Return the the useFit state

getVal()

Returns the experimental value assigned to this spin

setCVal(cval)

Sets the calculated value assigned to this spin

Parameters:
  • cval – The experimental value
setCoord(coord)

Update the coordinates of the spin

Parameters:
  • coord – The coordinates of the spin in a numpy array [x, y, z]
setCoordx(coord_x)

Update the x coordinate of the spin

Parameters:
  • coord_x – The x coordinate of the spin
setCoordy(coord_y)

Update the y coordinate of the spin

Parameters:
  • coord_y – The y coordinate of the spin
setCoordz(coord_z)

Update the z coordinate of the spin

Parameters:
  • coord_z – The z coordinate of the spin
setId(r_id)

Update the residue id

Parameters:
  • r_id – The residue id
setName(name)

Update the spin type

Parameters:
  • name – The atom type (atom identifier, must agree with PDB file)
setTol(tol)

Update the experimental tolerance

Parameters:
  • tol – The experimental tolerance
setUseFit(val)

Alter the useFit state, Only 0 (use) or 1 (do not use) are possible.

Parameters:
  • val – Toogle value (0, or 1)
setVal(val)

Update the experimental value

Parameters:
  • val – The experimental value
class ParaData.RDCData(spin_type, spin_id, exp_val, e_tol, s_coord, spin_type2, s_coord2, useFit=0)

Storage and access to experimental RDC data and associated coordinates

A RDC data container. Paramagnetic effect type will be rdc

Parameters:
  • spin_type – The spin type (atom identifier) of spin 1 in the RDC
  • spin_id – The residue id (residue number for the given atom)
  • exp_val – The experimental value
  • e_tol – The experimental tolerance
  • s_coord – The coordinates of spin 1 in the RDC
  • spin_type2 – The spin type (atom identifier) of spin 2 in the RDC
  • s_coord2 – The coordinates of spin 2 in the RDC
  • useFit – Use this experimental values in fit [OPTIONAL]

:type useFit : boolean

Example Usage/Doctests

>>> # This tests all getter/setter methods. As a result of inheritence
>>> # these tests should sufficiently cover the ParaData base class
>>> # the PCS and PRE classes. RDC will require some additional testing!
>>> import sys
>>> import os
>>> from numpy import *
>>> sys.path.append(os.path.abspath('.'))
>>> st1   = 'H'
>>> st2   = 'N'
>>> rid  = 21
>>> erdc = 5.5
>>> etol = 0.5
>>> cxyz1 = [1., 10., -11.]
>>> cxyz1 = array(cxyz1)
>>> cxyz2 = [2., 11., -10.]
>>> cxyz2 = array(cxyz2)
>>> dat = RDCData(st1,rid,erdc,etol,cxyz1, st2, cxyz2)
>>> # Check
>>> dat.getCVal(), dat.getCoord()
(0.0, (array([  1.,  10., -11.]), array([  2.,  11., -10.])))
>>> dat.getCoordx(), dat.getCoordy(), dat.getCoordz()
((1.0, 2.0), (10.0, 11.0), (-11.0, -10.0))
>>> dat.getId(), dat.getName(), dat.getTol(),dat.getType(), dat.getVal()
(21, 'HN', 0.5, 'rdc', 5.5)
>>> #Update, check
>>> dat.setCVal(6.)
>>> ncxyz = -100., 0., 8.
>>> ncxyz = array(ncxyz)
>>> dat.setCoord(ncxyz)
>>> dat.setId(98)
>>> dat.setName('C')
>>> dat.setTol(0.5)
>>> dat.setVal(6.73)
>>> # Check
>>> dat.getCVal(), dat.getCoord()
(6.0, (array([-100.,    0.,    8.]), array([  2.,  11., -10.])))
>>> dat.getCoordx(), dat.getCoordy(), dat.getCoordz()
((-100.0, 2.0), (0.0, 11.0), (8.0, -10.0))
>>> dat.getId(), dat.getName(), dat.getTol(),dat.getType(), dat.getVal()
(98, 'CN', 0.5, 'rdc', 6.7300000000000004)
>>> dat.getUseFit()
0
>>> dat.setUseFit(2)
Only 0 or 1 are supported
>>> dat.setUseFit(1)
>>> dat.getUseFit()
1
getCVal()

Returns the calculated value assigned to this spin

Until a calculation by a Calcer, this value will be 0.0

getCoord()

Returns the coordinates of both spins in the coupling

getCoordx()

Returns the x coordinates of both spins in the coupling

getCoordy()

Returns the y coordinates of both spins in the coupling

getCoordz()

Returns the z coordinates of both spins in the coupling

getId()

Returns the residue number assigned to this spin

getName()

Return the coupling type (concatenate the two spin identifiers)

getTol()

Returns the experimental tolerance assigned to this spin

getType()

Returns the paramagnetic type assigned to this spin

Can be: unknown, pcs, pre, or rdc

getUseFit()

Return the the useFit state

getVal()

Returns the experimental value assigned to this spin

setCVal(cval)

Sets the calculated value assigned to this spin

Parameters:
  • cval – The experimental value
setCoord(coord)

Update the coordinates of the spin

Parameters:
  • coord – The coordinates of the spin in a numpy array [x, y, z]
setCoord2(coord2)

Update the coordinates for the second spin

Parameters:
  • coord2 – The spin cordinates
setCoord2x(coord2_x)

Update the x coordinate for the second spin

Parameters:
  • coord2_x – The cordinate
setCoord2y(coord2_y)

Update the y coordinate for the second spin

Parameters:
  • coord2_y – The cordinate
setCoord2z(coord2_z)

Update the z coordinate for the second spin

Parameters:
  • coord2_z – The cordinate
setCoordx(coord_x)

Update the x coordinate of the spin

Parameters:
  • coord_x – The x coordinate of the spin
setCoordy(coord_y)

Update the y coordinate of the spin

Parameters:
  • coord_y – The y coordinate of the spin
setCoordz(coord_z)

Update the z coordinate of the spin

Parameters:
  • coord_z – The z coordinate of the spin
setId(r_id)

Update the residue id

Parameters:
  • r_id – The residue id
setName(name)

Update the spin type

Parameters:
  • name – The atom type (atom identifier, must agree with PDB file)
setName2(name2)

Update the spin type for the second spin

Parameters:
  • name2 – The atom type
setTol(tol)

Update the experimental tolerance

Parameters:
  • tol – The experimental tolerance
setUseFit(val)

Alter the useFit state, Only 0 (use) or 1 (do not use) are possible.

Parameters:
  • val – Toogle value (0, or 1)
setVal(val)

Update the experimental value

Parameters:
  • val – The experimental value

Quirks/TODO

  • Incorporate an optional flag “use”. This could be exploited while fitting. If the “use” flag is, set to no, the spin is not used during the fitting procedure.
  • Modify the __init__ methods such that they are more consistent with the Numbat format. It should be spin_id, spin_type, ...