deeplc.data
Dataset classes and utilities for DeepLC.
- class deeplc.data.DeepLCDataset(peptidoforms, target_retention_times=None, add_ccs_features=False)
Bases:
DatasetInitialize the DeepLCDataset.
- Parameters:
peptidoforms (list[Peptidoform | str]) – A list of peptidoforms, which can be either Peptidoform objects or their string representations.
target_retention_times (np.ndarray | None) – An array of target retention times corresponding to the peptidoforms. If None, targets will be set to NaN.
add_ccs_features (bool) – Whether to include CCS features in the encoded representation. Default is False.
- Raises:
ValueError – If
target_retention_timesis provided and its length does not match the number of peptidoforms.
- classmethod from_psm_list(psm_list, add_ccs_features=False)
Create a DeepLCDataset from a PSMList.
- Parameters:
- Returns:
A DeepLCDataset instance created from the provided PSMList.
- Return type:
- deeplc.data.split_datasets(train_data: _DatasetT, validation_data: _DatasetT, validation_split: float) tuple[_DatasetT, _DatasetT]
- deeplc.data.split_datasets(train_data: _DatasetT, validation_data: None, validation_split: float) tuple[Subset[_DatasetT], Subset[_DatasetT]]
Split the dataset into training and validation sets.
- Parameters:
- Returns:
A tuple containing the training and validation datasets.
- Return type:
- Raises:
ValueError – If validation_data is None and train_data does not implement
__len__method.