process
TemperatureDict
Bases: TypedDict
TypedDict for temperature dictionary.
Source code in hdxms_datasets/process.py
147 148 149 150 151 |
|
aggregate_columns(df, columns, by=['start', 'end', 'exposure'])
Aggregate the DataFrame the specified columns by intensity-weighted average.
Source code in hdxms_datasets/process.py
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
|
compute_uptake_metrics(df, exception='raise')
Tries to add derived columns to the DataFrame. Possible columns to add are: uptake, uptake_sd, fd_uptake, fd_uptake_sd, rfu, max_uptake.
Source code in hdxms_datasets/process.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 |
|
convert_temperature(temperature_dict, target_unit='C')
Convenience function to convert temperature values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
temperature_dict
|
TemperatureDict
|
Dictionary with temperature value(s) and unit. |
required |
target_unit
|
str
|
Target unit for temperature. Must be "C, or "K" |
'C'
|
Returns:
Type | Description |
---|---|
float
|
Converted temperature value(s). |
Source code in hdxms_datasets/process.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
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
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
|
drop_null_columns(df)
Drop columns that are all null from the DataFrame.
Source code in hdxms_datasets/process.py
359 360 361 362 |
|
dynamx_cluster_to_state(cluster_data, nd_exposure=0.0)
convert dynamx cluster data to state data must contain only a single state
Source code in hdxms_datasets/process.py
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 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
filter_peptides(df, state=None, exposure=None)
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
|
time_unit
|
Time unit for exposure column of supplied dataframe. |
required |
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
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
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
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
|
records_to_dict(records)
Convert a list of records to a dictionary of lists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
records
|
list[dict]
|
List of dictionaries. |
required |
Returns:
Type | Description |
---|---|
dict[str, list]
|
Dictionary with keys as column names and values as lists. |
Source code in hdxms_datasets/process.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
sort(df)
Sorts the DataFrame by state, exposure, start, end, file.
Source code in hdxms_datasets/process.py
352 353 354 355 356 |
|
ufloat_stats(array, weights)
Calculate the weighted mean and standard deviation.
Source code in hdxms_datasets/process.py
47 48 49 50 |
|