process
convert_temperature(temperature_dict, target_unit='c')
Convenience function to convert temperature values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
temperature_dict |
dict
|
Dictionary with temperature value(s) and unit. |
required |
target_unit |
str
|
Target unit for temperature. Must be "c", "k", "celsius", or "kelvin" and is case-insensitive. |
'c'
|
Returns:
Type | Description |
---|---|
Union[float, list[float]]
|
Converted temperature value(s). |
Source code in hdxms_datasets/process.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
convert_time(time_dict, target_unit='s')
Convenience function to convert time values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time_dict |
dict
|
Dictionary with time value(s) and unit. |
required |
target_unit |
Literal['s', 'min', 'h']
|
Target unit for time. |
's'
|
Returns:
Type | Description |
---|---|
Union[float, list[float]]
|
Converted time value(s). |
Source code in hdxms_datasets/process.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
filter_peptides(df, state=None, exposure=None, query=None, dropna=True, time_unit='s')
Convenience function to filter a peptides DataFrame. .
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
DataFrame
|
Input dataframe. |
required |
state |
Optional[str]
|
Name of protein state to select. |
None
|
exposure |
Optional[dict]
|
Exposure value(s) to select. Exposure is given as a :obj: |
None
|
query |
Optional[list[str]]
|
Additional queries to pass to pandas.DataFrame.query. |
None
|
dropna |
bool
|
Drop rows with |
True
|
time_unit |
str
|
Time unit for exposure column of supplied dataframe. |
's'
|
Examples:
Filter peptides for a specific protein state and exposure time:
>>> d = {"state", "SecB WT apo", "exposure": {"value": 0.167, "unit": "min"}
>>> filtered_df = filter_peptides(df, **d)
Returns:
Type | Description |
---|---|
DataFrame
|
Filtered dataframe. |
Source code in hdxms_datasets/process.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
parse_data_files(data_file_spec, data_dir)
Parse data file specifications from a YAML file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_file_spec |
dict
|
Dictionary with data file specifications. |
required |
data_dir |
Path
|
Path to data directory. |
required |
Returns:
Type | Description |
---|---|
dict[str, DataFile]
|
Dictionary with parsed data file specifications. |
Source code in hdxms_datasets/process.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|