peptdeep.model.ccs

Classes:

AlphaCCSModel([dropout])

ModelInterface for Model_CCS_LSTM or Model_CCS_Bert

Model_CCS_Bert([dropout, nlayers, hidden, ...])

Transformer model for CCS prediction

Model_CCS_LSTM([dropout])

LSTM model for CCS prediction

Functions:

ccs_to_mobility_pred_df(precursor_df)

Add 'mobility_pred' into precursor_df inplace

mobility_to_ccs_df_(precursor_df)

Add 'ccs' into precursor_df inplace

class peptdeep.model.ccs.AlphaCCSModel(dropout=0.1, model_class: Module = <class 'peptdeep.model.ccs.Model_CCS_LSTM'>, device: str = 'gpu', **kwargs)[source][source]

Bases: ModelInterface

ModelInterface for Model_CCS_LSTM or Model_CCS_Bert

Methods:

__init__([dropout])

ccs_to_mobility_pred(precursor_df)

test(precursor_df, *[, x, y, batch_size])

__init__(dropout=0.1, model_class: Module = <class 'peptdeep.model.ccs.Model_CCS_LSTM'>, device: str = 'gpu', **kwargs)[source][source]
Parameters:
  • device (str, optional) – device type in ‘get_available’, ‘cpu’, ‘mps’, ‘gpu’ (or ‘cuda’), by default ‘gpu’

  • fixed_sequence_len (int, optional) – See fixed_sequence_len, defaults to 0.

  • min_pred_value (float, optional) – See min_pred_value, defaults to 0.0.

ccs_to_mobility_pred(precursor_df: DataFrame) DataFrame[source][source]
test(precursor_df: DataFrame, *, x: Literal['ccs_pred', 'mobility_pred'] = 'ccs_pred', y: Literal['ccs', 'mobility'] = 'ccs', batch_size: int = 1024)[source][source]
class peptdeep.model.ccs.Model_CCS_Bert(dropout=0.1, nlayers=4, hidden=128, output_attentions=False, **kwargs)[source][source]

Bases: Module

Transformer model for CCS prediction

Methods:

__init__([dropout, nlayers, hidden, ...])

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(aa_indices, mod_x, charges)

Define the computation performed at every call.

Attributes:

__init__(dropout=0.1, nlayers=4, hidden=128, output_attentions=False, **kwargs)[source][source]

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(aa_indices, mod_x, charges: Tensor)[source][source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

property output_attentions
class peptdeep.model.ccs.Model_CCS_LSTM(dropout=0.1)[source][source]

Bases: Module

LSTM model for CCS prediction

Methods:

__init__([dropout])

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(aa_indices, mod_x, charges)

Define the computation performed at every call.

__init__(dropout=0.1)[source][source]

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(aa_indices, mod_x, charges)[source][source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

peptdeep.model.ccs.ccs_to_mobility_pred_df(precursor_df: DataFrame) DataFrame[source][source]

Add ‘mobility_pred’ into precursor_df inplace

peptdeep.model.ccs.mobility_to_ccs_df_(precursor_df: DataFrame) DataFrame[source][source]

Add ‘ccs’ into precursor_df inplace