peptdeep.model.rt

Classes:

AlphaRTModel([dropout])

ModelInterface for RT models

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

Transformer model for RT prediction

Model_RT_LSTM

Model_RT_LSTM_CNN([dropout])

CNN+LSTM model for RT prediction

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

Bases: ModelInterface

ModelInterface for RT models

Methods:

__init__([dropout])

add_irt_column_to_precursor_df(precursor_df)

test(precursor_df, *[, batch_size])

__init__(dropout=0.1, model_class: Module = <class 'peptdeep.model.rt.Model_RT_LSTM_CNN'>, 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.

add_irt_column_to_precursor_df(precursor_df: DataFrame, irt_pep_df: DataFrame = None)[source][source]
test(precursor_df: DataFrame, *, batch_size: int = 1024)[source][source]
class peptdeep.model.rt.Model_RT_Bert(dropout=0.1, nlayers=4, hidden=128, output_attentions=False, **kwargs)[source][source]

Bases: Module

Transformer model for RT prediction

Methods:

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

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

forward(aa_indices, mod_x)

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)[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
peptdeep.model.rt.Model_RT_LSTM[source]

alias of Model_RT_LSTM_CNN

class peptdeep.model.rt.Model_RT_LSTM_CNN(dropout=0.2)[source][source]

Bases: Module

CNN+LSTM model for RT prediction

Methods:

__init__([dropout])

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

forward(aa_indices, mod_x)

Define the computation performed at every call.

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

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

forward(aa_indices, mod_x)[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.