LowRank.Component#

LowRank.Component.py

This module contains the class Component, which is used to store information about each component of a LowRankInfo.

class Component(icurve_array, jcurve_array, ccurve)#

Bases: object

A class to represent a component. It contains the i-curve, j-curve, concentration curve, and related information.

icurve_array#

The i-curve array, where the first column is x and the second column is y

Type:

array-like, shape (N, 2)

jcurve_array#

The j-curve array, where the first column is x, the second column is y and the third column is error.

Type:

array-like, shape (M, 3)

ccurve#

The concentration curve.

Type:

array-like, shape (N,)

peak_index#

The index of the peak in the i-curve.

Type:

int

icurve#

The i-curve object. It is None until it is computed.

Type:

Curve or None

jcurve#

The j-curve object. It is None until it is computed.

Type:

Curve or None

area#

The area under the i-curve. It is None until it is computed.

Type:

float or None

ccurve#

The concentration curve.

Type:

array-like, shape (N,)

Parameters:
  • icurve_array (array-like, shape (N, 2)) – The i-curve array, where the first column is x and the second column is y.

  • jcurve_array (array-like, shape (M, 3)) – The j-curve array, where the first column is x, the second column is y, and the third column is error.

  • ccurve (array-like, shape (N,)) – The concentration curve.

get_icurve()#

Returns the i-curve object instead of the array.

Return type:

The i-curve object which is of type Curve.

get_jcurve()#

Returns the j-curve object instead of the array.

Return type:

The j-curve object which is of type Curve.

get_jcurve_array()#

Returns the j-curve array which contains qv, I and error in case of XR.

Currently, error is zeros in case of UV.

This type of array is used as portable data storage for SAXS tools.

Return type:

The j-curve array which is of type numpy array of shape (M, 3).

compute_area()#

Compute the area under the i-curve.

Returns:

The area under the i-curve.

Return type:

float

compute_range(area_ratio, debug=False, return_also_fig=False)#

Compute the range of the i-curve that contains the given area ratio. The range is determined by finding the height that gives the desired area ratio and then finding the corresponding x values on the ascending and descending parts of the curve.

Parameters:
  • area_ratio (float) – The area ratio to compute the range for. It should be between 0 and 1.

  • debug (bool, optional) – If True, print debug information and show a plot of the i-curve with the computed range. Default is False.

  • return_also_fig (bool, optional) – If True, return the matplotlib figure object along with the range. Default is False.

Returns:

A tuple containing the start and stop indices of the range.

Return type:

tuple

make_paired_range(range_, minor=False, elm_recs=None, debug=False)#

Create a paired range from the given range. :param range_: The range to create the paired range from. :type range_: tuple of (int, int) :param minor: If True, create a minor paired range (i.e., only one range).

If False, create a major paired range (i.e., two ranges). Default is False.

Parameters:
  • elm_recs (list or None, optional) – The elution records associated with the ranges. Default is None.

  • debug (bool, optional) – If True, print debug information. Default is False.

Returns:

The created PairedRange object.

Return type:

PairedRange

class XrComponent(*args)#

Bases: Component

A class to represent an X-ray component. It contains the i-curve, j-curve, concentration curve, and related information.

sg#

The SimpleGuinier object for Rg computation. It is None until it is computed.

Type:

SimpleGuinier or None

Parameters:
  • icurve_array (array-like, shape (N, 2)) – The i-curve array, where the first column is x and the second column is y.

  • jcurve_array (array-like, shape (M, 3)) – The j-curve array, where the first column is x, the second column is y, and the third column is error.

  • ccurve (array-like, shape (N,)) – The concentration curve.

get_guinier_object()#

Get the SimpleGuinier object for Rg computation.

Returns:

The SimpleGuinier object.

Return type:

SimpleGuinier

compute_rg(return_object=False)#

Compute the Rg of the component.

Parameters:

return_object (bool, optional) – If True, return the Guinier object instead of Rg value.

class UvComponent(*args)#

Bases: Component

A class to represent a UV component.

Parameters:
  • icurve_array (array-like, shape (N, 2)) – The i-curve array, where the first column is x and the second column is y.

  • jcurve_array (array-like, shape (M, 3)) – The j-curve array, where the first column is x, the second column is y, and the third column is error.

  • ccurve (array-like, shape (N,)) – The concentration curve.