mh_utils.worklist_parser.columns

Properties for columns in a Worklist.

Classes:

Column(name, attribute_id, attribute_type, …)

Represents a column in a worklist.

Functions:

injection_volume(val)

Handle special case for injection volume of -1, which indicates “As Method”.

class Column(name, attribute_id, attribute_type, dtype, default_value, field_type=None, reorder_id=None)[source]

Bases: object

Represents a column in a worklist.

Parameters
  • name – The name of the column

  • attribute_id

  • attribute_type – can be System Defined = 0, System Used = 1, User Added = 2

  • dtype (Callable)

  • default_value (Any)

  • field_type (Optional[int]) – Each of the system defined columns have a field type starting from sampleid = 0 to reserved6 = 24. The system used column can be ‘compound param’ = 35, ‘optim param’ = 36, ‘mass param’ = 37 and ‘protein param’ = 38. The User added columns start from 45. Default None.

  • reorder_id (Optional[int]) – Default None.

Methods:

__eq__(other)

Return self == other.

__ge__(other)

Return self >= other.

__getstate__()

Used for pickling.

__gt__(other)

Return self > other.

__le__(other)

Return self <= other.

__lt__(other)

Return self < other.

__ne__(other)

Return self != other.

__repr__()

Return a string representation of the Column.

__setstate__(state)

Used for pickling.

cast_value(value)

Cast value to the dtype of this column.

from_attribute(attribute)

Construct a column for an Attribute.

from_dict(d)

Construct an instance of Column from a dictionary.

to_dict([convert_values])

Returns a dictionary containing the contents of the Column object.

Attributes:

attribute_id

attribute_type

can be System Defined = 0, System Used = 1, User Added = 2

default_value

dtype

field_type

Each of the system defined columns have a field type starting from sampleid = 0 to reserved6 = 24.

name

The name of the column

reorder_id

__eq__(other)

Return self == other.

Return type

bool

__ge__(other)

Return self >= other.

Return type

bool

__getstate__()

Used for pickling.

Automatically created by attrs.

__gt__(other)

Return self > other.

Return type

bool

__le__(other)

Return self <= other.

Return type

bool

__lt__(other)

Return self < other.

Return type

bool

__ne__(other)

Return self != other.

Return type

bool

__repr__()

Return a string representation of the Column.

Return type

str

__setstate__(state)

Used for pickling.

Automatically created by attrs.

attribute_id

Type:    int

attribute_type

Type:    AttributeType

can be System Defined = 0, System Used = 1, User Added = 2

cast_value(value)[source]

Cast value to the dtype of this column.

default_value

Type:    Any

dtype

Type:    Callable

field_type

Type:    Optional[int]

Each of the system defined columns have a field type starting from sampleid = 0 to reserved6 = 24. The system used column can be ‘compound param’ = 35, ‘optim param’ = 36, ‘mass param’ = 37 and ‘protein param’ = 38. The User added columns start from 45.

classmethod from_attribute(attribute)[source]

Construct a column for an Attribute.

Return type

Column

classmethod from_dict(d)

Construct an instance of Column from a dictionary.

Parameters

d (Mapping[str, Any]) – The dictionary

name

Type:    str

The name of the column

reorder_id

Type:    Optional[int]

to_dict(convert_values=False)

Returns a dictionary containing the contents of the Column object.

Parameters

convert_values (bool) – Recursively convert values into dictionaries, lists etc. as appropriate. Default False.

Return type

MutableMapping[str, Any]

injection_volume(val)[source]

Handle special case for injection volume of -1, which indicates “As Method”.

Parameters

val (Union[float, str])

Returns

Return type

Union[int, str]

columns

Mapping of column names to column objects.