paramagpy.fit.nlr_fit_metal_from_pcs

paramagpy.fit.nlr_fit_metal_from_pcs(initMetals, dataArrays, params=('x', 'y', 'z', 'ax', 'rh', 'a', 'b', 'g'), ensembleAverage=False, userads=False, useracs=False, progress=None)[source]

Fit deltaChi tensor to PCS values using non-linear regression.

Parameters
  • initMetals (list of Metal objects) – a list of metals used as starting points for fitting. a list must always be provided, but may also contain only one element. If multiple metals are provided, each metal is fitted to their respective PCS dataset by index in <dataArrays, but all are fitted to a common position.

  • dataArrays (list of PCS dataArray) – each PCS dataArray must correspond to an associated metal for fitting. each PCS dataArray has structure determined by paramagpy.protein.CustomStructure.parse().

  • params (list of str) – the parameters to be fit. For example [‘x’,’y’,’z’,’ax’,’rh’,’a’,’b’,’g’,’shift’]

  • ensembleAverage (bool, optional) – when False, each model of the structure is fit independently. The parameters for each fitted tensor are then averaged before returning the final averaged tensor. When True, the structure models are treated as an ensemble and ensemble averaging of calculated PCS/PRE/RDC/CCR values is conducted at all stages of fitting to fit a single tensor to all models simultaneously. The ‘idx’ column of the dataArray determines the ensemble averaging behaviour with common indices for atoms between models resulting in their summation.

  • userads (bool, optional) – include residual anisotropic dipolar shielding (RADS) during fitting

  • useracs (bool, optional) – include residual anisotropic chemical shielding (RACS) during fitting. CSA tensors are taken using the <csa> method of atoms.

  • progress (object, optional) – to keep track of the calculation, progress.set(x) is called each iteration and varies from 0.0 -> 1.0 when the calculation is complete.

Returns

  • fitMetals (list of metals) – a list of the fitted tensors.

  • dataArrays (list of dataArray) – each dataArray is copy of the original dataArray with the ‘cal’ column populated with back-calculated values from the fitted tensor.