mh_utils.worklist_parser.columns

Properties for columns in a Worklist.

Column(name, attribute_id, attribute_type, …)

Represents a column in a worklist.

injection_volume(val)

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

columns

Mapping of column names to column objects.

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 (str) – The name of the column

  • attribute_id (int)

  • attribute_type (AttributeType) – The attribute type identifier.

  • dtype (Callable) – The field datatype.

  • default_value (Any)

  • field_type (Optional[int]) – The field type identifier. Default None.

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

attribute_id

Type:    int

attribute_type

Type:    AttributeType

The attribute type identifier.

Can be System Defined (0), System Used (1), or 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]

The field type identifier.

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 a mh_utils.worklist_parser.classes.Attribute.

Parameters

attribute (Attribute) – 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.