PPTs logo

Table Of Contents

The FitPara module

Introduction and notes

API Documentation, Usage Examples and Doctests

class FitPara.PCS(*pObjList)

Collection of fitters (& related methods) for PCS datasets

AnglesUTR(ref=0, verbose=1)

Reconfigure a X-tensor or Alignment-tensor into Unique Tensor Rep

Core code has been borrowed from Numbat. Information on UTR can be found i JBNMR. 2008 Jul;41(3):179-89. Thanks Christophe Schmitz :-)

Parameters:
  • ref – The reference of ParaParser object associated with this fitter. This defaults to 0 (the first ParaParser object) [OPTIONAL]
  • verbose – Toggle between printing information on the UTR case (0) or being quiet (non-zero). Default is non-zero (not printing) [OPTIONAL]
Return type:

a list containing Ax, Rh, A, B and G in UTR.

FitQ(soln, info, p0, cov, mesg, success, verbose=0)

Calculates the quality of the fit and estimates for parameter error

From: http://mail.scipy.org/pipermail/scipy-dev/2009-March/011527.html

Parameters:
  • soln – The solution returned from a fitting call
  • info – The optional outputs returned from a fitting call
  • p0 – The initial estimates for the parameters
  • cov – The determined jacobian around the solution returned from a fitting call. Note this can be None if there is ifinite covariance in some direction

:param mesg The optimization message (relating to success) :type mesg: str :param success: The integer exit code. <=4 for successful optimization :type success: int :param verbose: Toggle between print and returning (0) or just returning

(non-zero) the calculations performed in this method [OPTIONAL].Defaults to printing and returning
Return type:list containing soln, p0, error estimates for soln, chisq, rms of residuals and reduced chisq
T1M1(maxcs=10000, error=None)

Fit a single X-tensor to a single structural model

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
T1M1FM(maxcs=10000, error=None)

Fit a single X-tensor to a single model with metal position fixed

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
T1M2(maxcs=10000, error=None)

Fit a single X-tensor to two corresponding structural models

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
T1M2FM(maxcs=10000, error=None)

Fit a single X-tensor (fixed metal pos) to two corres. models

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
T1MN(maxcs=10000, error=None)

Fit a single X-tensor to N structural models

Equivalent to Numbat’s “SELECT CONFORMER” option.

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
T1MNFM(maxcs=10000, error=None)

Fit a single X-tensor to N models with metal position fixed

Equivalent to Numbat’s “SELECT CONFORMER” option with metal pos fixed.

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
T2M1(maxcs=10000, error=None)

Fit two X-tensor’s to a single structural model

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
T2M1FM1(maxcs=10000, error=None)

Fit two X-tensor’s to a single model with metal pos a site 1 fixed

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
T2M1FM1FM2(maxcs=10000, error=None)

Fit two X-tensor’s to a single model metal pos at both sites fixed

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
TNM1CM(maxcs=10000, error=None)

Fit N X-tensor’s to a single model constraining the metal position

This is equivalent to Numbat’s “MULTIPLE PCS” option. There is no limit on the number of paraParser objects in this fit.

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
TXM1(maxcs=10000, error=None)

Fit N X-tensors to a single structural model

This can be used to study quaternary structure.

This can be used to study multiple metal binding sites in a single experiment

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
getParams(ref=0)

Return all spin x,y,z, assigned PCS and X-tensor parameters

Parameters:
  • ref – The list index refering to the paraParser object of interest [OPTIONAL]. This defaults to the first object stored in the list
opts()

Print the type of optimization that can be performed on PCS data

printParams(ref=0)

Prints the X-tensor parameters

Parameters:
  • ref – The list index refering to the ParaParser object of interest [OPTIONAL]. This defaults to the first object stored in the list
updateFromFit(soln, ref=0)

Update ParaParser object with the X-tensor parameters determined

Parameters:
  • soln – A solution array in the for [mx,my,mz, Ax, Rh, A,B,G ]
  • ref – The list index refering to the ParaParser object of interest [OPTIONAL]. This defaults to the first object stored in the list
class FitPara.PRE(*pObjList)

Collection of fitters (& related methods) for PRE datasets

C1M1(maxcs=10000, error=None)

Fit a single PRE centre to a single structural model with PRE_C given

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
C1M1OC(maxcs=10000, error=None)

Fit a single PRE centre to a single model with PRE_C optimized

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
C1M2(maxcs=10000, error=None)

Fit a single PRE centre to two corresponding structural models

PRE_C is provided (fixed during optimization)

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
C1M2OC(maxcs=10000, error=None)

Fit a single PRE centre to two corresponding structural models

PRE_C is optimized

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
C1MN(maxcs=10000, error=None)

Fit a single PRE centre to N structural models with PRE_C given

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
C1MNOC(maxcs=10000, error=None)

Fit a single PRE centre to N structural models with PRE_C optimized

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
C2M1(maxcs=10000, error=None)

Fit two PRE centres to a single structural model. PRE_C given

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
C2M1FM1(maxcs=10000, error=None)

Fit (two) PRE centres to a single structural model. PRE_C given

The site of the 1st PRE centre is fixed. The value for PRE_C is defined from the second site.

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
C2M1FM1OC(maxcs=10000, error=None)

Fit (two) PRE centres to a single structural model. PRE_C optimized

The site of the 1st PRE centre is fixed.

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
C2M1OC(maxcs=10000, error=None)

Fit two PRE centres to a single structural model. PRE_C optimized

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
CXM1(maxcs=10000, error=None)

Fit X PRE centres to a single structural model. PRE_C is provided.

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
CXM1OC(maxcs=10000, error=None)
FitQ(soln, info, p0, cov, mesg, success, verbose=0)

Calculates the quality of the fit and estimates for parameter error

From: http://mail.scipy.org/pipermail/scipy-dev/2009-March/011527.html

Parameters:
  • soln – The solution returned from a fitting call
  • info – The optional outputs returned from a fitting call
  • p0 – The initial estimates for the parameters
  • cov – The determined jacobian around the solution returned from a fitting call. Note this can be None if there is ifinite covariance in some direction

:param mesg The optimization message (relating to success) :type mesg: str :param success: The integer exit code. <=4 for successful optimization :type success: int :param verbose: Toggle between print and returning (0) or just returning

(non-zero) the calculations performed in this method [OPTIONAL].Defaults to printing and returning
Return type:list containing soln, p0, error estimates for soln, chisq, rms of residuals and reduced chisq
getParams(ref=0)

Return all spin x,y,z, assigned PRE, tol, and PRE centre parameters

Parameters:
  • ref – The list index refering to the paraParser object of interest [OPTIONAL]. This defaults to the first object stored in the list
Return type:

arrays of the models x,y,z coords, meas. PRE and site params

opts()

Print the type of optimization that can be performed on PRE data

printParams(ref=0)

Prints the PRE centre parameters

Parameters:
  • ref – The list index refering to the ParaParser object of interest [OPTIONAL]. This defaults to the first object stored in the list
updateFromFit(soln, ref=0)

Update ParaParser object with the PRE centre parameters determined

Parameters:
  • soln – An solution array in the form [mx, my, mz, preC]
  • ref – The list index refering to the ParaParser object of interest [OPTIONAL]. This defaults to the first object stored in the list
class FitPara.ParaEffect

Collection of fitting (& related) methods common to paramagnetic effects

This is a base class.

FitQ(soln, info, p0, cov, mesg, success, verbose=0)

Calculates the quality of the fit and estimates for parameter error

From: http://mail.scipy.org/pipermail/scipy-dev/2009-March/011527.html

Parameters:
  • soln – The solution returned from a fitting call
  • info – The optional outputs returned from a fitting call
  • p0 – The initial estimates for the parameters
  • cov – The determined jacobian around the solution returned from a fitting call. Note this can be None if there is ifinite covariance in some direction

:param mesg The optimization message (relating to success) :type mesg: str :param success: The integer exit code. <=4 for successful optimization :type success: int :param verbose: Toggle between print and returning (0) or just returning

(non-zero) the calculations performed in this method [OPTIONAL].Defaults to printing and returning
Return type:list containing soln, p0, error estimates for soln, chisq, rms of residuals and reduced chisq
class FitPara.ParaEffectAdv

Collection of fitting (& related) methods common to PCS and RDC effects

This is a base class.

AnglesUTR(ref=0, verbose=1)

Reconfigure a X-tensor or Alignment-tensor into Unique Tensor Rep

Core code has been borrowed from Numbat. Information on UTR can be found i JBNMR. 2008 Jul;41(3):179-89. Thanks Christophe Schmitz :-)

Parameters:
  • ref – The reference of ParaParser object associated with this fitter. This defaults to 0 (the first ParaParser object) [OPTIONAL]
  • verbose – Toggle between printing information on the UTR case (0) or being quiet (non-zero). Default is non-zero (not printing) [OPTIONAL]
Return type:

a list containing Ax, Rh, A, B and G in UTR.

class FitPara.RDC(*pObjList)

Collection of fitters (& related methods) for RDC datasets

A1M1(maxcs=10000, error=None)

Fit a single Alignment-tensor to a single structural model

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
A1M2(maxcs=10000, error=None)
A1MN(maxcs=10000, error=None)

Fit a single Alignment-tensor to a multiple structural models

Parameters:
  • maxcs – The maximum number of calls during the optimization. This may need to be adjusted [OPTIONAL]. Defaults to 10000
  • error – Sets the shape of the error function [OPTIONAL]. Defaults to None
A2M1(maxcs=10000, error=None)
AXM1(maxcs=10000, error=None)
AnglesUTR(ref=0, verbose=1)

Reconfigure a X-tensor or Alignment-tensor into Unique Tensor Rep

Core code has been borrowed from Numbat. Information on UTR can be found i JBNMR. 2008 Jul;41(3):179-89. Thanks Christophe Schmitz :-)

Parameters:
  • ref – The reference of ParaParser object associated with this fitter. This defaults to 0 (the first ParaParser object) [OPTIONAL]
  • verbose – Toggle between printing information on the UTR case (0) or being quiet (non-zero). Default is non-zero (not printing) [OPTIONAL]
Return type:

a list containing Ax, Rh, A, B and G in UTR.

FitQ(soln, info, p0, cov, mesg, success, verbose=0)

Calculates the quality of the fit and estimates for parameter error

From: http://mail.scipy.org/pipermail/scipy-dev/2009-March/011527.html

Parameters:
  • soln – The solution returned from a fitting call
  • info – The optional outputs returned from a fitting call
  • p0 – The initial estimates for the parameters
  • cov – The determined jacobian around the solution returned from a fitting call. Note this can be None if there is ifinite covariance in some direction

:param mesg The optimization message (relating to success) :type mesg: str :param success: The integer exit code. <=4 for successful optimization :type success: int :param verbose: Toggle between print and returning (0) or just returning

(non-zero) the calculations performed in this method [OPTIONAL].Defaults to printing and returning
Return type:list containing soln, p0, error estimates for soln, chisq, rms of residuals and reduced chisq
getParams(ref=0)

Return all spin x,y,z, assigned RDC and alignment-tensor parameters

Parameters:
  • ref – The list index refering to the paraParser object of interest [OPTIONAL]. This defaults to the first object stored in the list
opts()

Print the type of optimization that can be performed on RDC data

printParams(ref=0)

Prints the Alignment-tensor parameters

Parameters:
  • ref – The list index refering to the ParaParser object of interest [OPTIONAL]. This defaults to the first object stored in the list
updateFromFit(soln, ref=0)

Update ParaParser object with the A-tensor parameters determined

Parameters:
  • soln – A solution array in the for [Ax, Rh, A,B,G ]
  • ref – The list index refering to the ParaParser object of interest [OPTIONAL]. This defaults to the first object stored in the list

Quirks/TODO