Rosetta
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
protocols::esm_perplexity::EsmPerplexityTensorflowProtocol Class Reference

Protocol to predict amino acid probabilities using the ESM language model family. More...

#include <EsmPerplexityTensorflowProtocol.hh>

Inheritance diagram for protocols::esm_perplexity::EsmPerplexityTensorflowProtocol:
Inheritance graph
[legend]

Public Member Functions

 EsmPerplexityTensorflowProtocol ()=default
 Default constructor. More...
 
 EsmPerplexityTensorflowProtocol (EsmPerplexityTensorflowProtocol const &)=default
 Copy constructor. More...
 
 ~EsmPerplexityTensorflowProtocol () override=default
 Destructor. More...
 
std::string name () const override
 Get the name of this protocol. More...
 
 EsmPerplexityTensorflowProtocol (std::string const &model)
 constructor with name of the model More...
 
basic::tensorflow_manager::RosettaTensorflowProtocolBaseOP clone () const override
 Clone operation: make a copy of this object, and return an owning pointer to the copy. More...
 
void set_defaults ()
 set default options More...
 
bool auto_download () const
 get auto_download value More...
 
void auto_download (bool setting)
 set the auto_download value More...
 

Static Public Member Functions

static basic::citation_manager::CitationCollectionBaseCOP get_ESM_neural_net_citation ()
 Get the citation for ESM. More...
 
static void softmax (std::map< core::Size, utility::vector1< core::Real >> const &logit_map, std::map< core::Size, utility::vector1< core::Real >> &softmax_map)
 The tensorflow session. More...
 
static void download_model_if_not_existing (std::string const &path_to_model, std::string const &base_url, bool const &auto_download)
 Downloads model from GitLab if the specified path does not exist or is empty. More...
 

Public Attributes

std::string model_name_
 path to the model More...
 

Static Public Attributes

static std::string const alphabet_ = "XXXXLAGVSERTIDPKQNFYMHWC"
 The ESM alphabet used for tokenization. More...
 

Static Protected Member Functions

static utility::vector1< core::Sizeget_selected_residues (core::select::residue_selector::ResidueSubset const &selected)
 Given a selection, return a vector if selected indices. More...
 

Static Private Member Functions

static bool is_model_valid (std::string const &model_name)
 Checks if the given model name is one of the available models. More...
 
static std::string concatenate_model_names ()
 Returns a string containing the names of all available models, separated by commas. More...
 

Private Attributes

bool auto_download_ = false
 

Static Private Attributes

static std::string const base_url_ = "https://git.iwe-lab.de/moritzertelt/ML_graphs/-/archive/main/ML_graphs-main.tar.gz?path=tensorflow_graphs/ESM/"
 
static std::vector< std::string > const available_models_ = {"esm2_t6_8M_UR50D", "esm2_t12_35M_UR50D", "esm2_t30_150M_UR50D", "esm2_t33_650M_UR50D"}
 

Detailed Description

Protocol to predict amino acid probabilities using the ESM language model family.

Author
Moritz Ertelt (morit.nosp@m.z.er.nosp@m.telt@.nosp@m.goog.nosp@m.lemai.nosp@m.l.co.nosp@m.m)

Constructor & Destructor Documentation

◆ EsmPerplexityTensorflowProtocol() [1/3]

protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::EsmPerplexityTensorflowProtocol ( )
default

Default constructor.

◆ EsmPerplexityTensorflowProtocol() [2/3]

protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::EsmPerplexityTensorflowProtocol ( EsmPerplexityTensorflowProtocol const &  )
default

Copy constructor.

◆ ~EsmPerplexityTensorflowProtocol()

protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::~EsmPerplexityTensorflowProtocol ( )
overridedefault

Destructor.

◆ EsmPerplexityTensorflowProtocol() [3/3]

protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::EsmPerplexityTensorflowProtocol ( std::string const &  model)
explicit

constructor with name of the model

Constructor using the model name to initialize the particular ESM model.

References set_defaults().

Member Function Documentation

◆ auto_download() [1/2]

bool protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::auto_download ( ) const
inline

get auto_download value

References auto_download_.

Referenced by download_model_if_not_existing(), and set_defaults().

◆ auto_download() [2/2]

void protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::auto_download ( bool  setting)

set the auto_download value

Set the auto_download bool.

References auto_download_.

◆ clone()

basic::tensorflow_manager::RosettaTensorflowProtocolBaseOP protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::clone ( ) const
override

Clone operation: make a copy of this object, and return an owning pointer to the copy.

◆ concatenate_model_names()

std::string protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::concatenate_model_names ( )
staticprivate

Returns a string containing the names of all available models, separated by commas.

References available_models_.

◆ download_model_if_not_existing()

void protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::download_model_if_not_existing ( std::string const &  path_to_model,
std::string const &  base_url,
bool const &  auto_download 
)
static

Downloads model from GitLab if the specified path does not exist or is empty.

Downloads model from GitLab if the specified path does not exist or is missing crucial files.

Parameters
[in]path_to_modelDirectory path where the model should be located
[in]base_urlUrl of the GitLab where models are stored
[in]auto_downloadWhether to automatically download missing models

References auto_download(), and protocols::TR().

◆ get_ESM_neural_net_citation()

basic::citation_manager::CitationCollectionBaseCOP protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::get_ESM_neural_net_citation ( )
static

◆ get_selected_residues()

utility::vector1< core::Size > protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::get_selected_residues ( core::select::residue_selector::ResidueSubset const &  selected)
staticprotected

Given a selection, return a vector if selected indices.

Given a selection, return the number of selected residues.

◆ is_model_valid()

bool protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::is_model_valid ( std::string const &  model_name)
staticprivate

Checks if the given model name is one of the available models.

References available_models_.

◆ name()

std::string protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::name ( ) const
override

Get the name of this protocol.

◆ set_defaults()

void protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::set_defaults ( )

set default options

References auto_download().

Referenced by EsmPerplexityTensorflowProtocol().

◆ softmax()

void protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::softmax ( std::map< core::Size, utility::vector1< core::Real >> const &  logit_map,
std::map< core::Size, utility::vector1< core::Real >> &  softmax_map 
)
static

The tensorflow session.

Function to return the softmax of logits resulting in probabilities.

Apply softmax function to logits

Parameters
[in]logit_mapA map of logits, where each key represents a residue and its predicted logits
[in,out]softmax_mapA map of softmax, where each key represents a residue and its predicted probabilities.

References core::scoring::epr_deer::logit(), and core::scoring::pair.

Referenced by protocols::esm_perplexity::PerResidueEsmProbabilitiesMetric::calculate().

Member Data Documentation

◆ alphabet_

std::string const protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::alphabet_ = "XXXXLAGVSERTIDPKQNFYMHWC"
static

The ESM alphabet used for tokenization.

Referenced by protocols::esm_perplexity::PerResidueEsmProbabilitiesMetric::fill_return_map().

◆ auto_download_

bool protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::auto_download_ = false
private

Referenced by auto_download().

◆ available_models_

std::vector< std::string > const protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::available_models_ = {"esm2_t6_8M_UR50D", "esm2_t12_35M_UR50D", "esm2_t30_150M_UR50D", "esm2_t33_650M_UR50D"}
staticprivate

◆ base_url_

std::string const protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::base_url_ = "https://git.iwe-lab.de/moritzertelt/ML_graphs/-/archive/main/ML_graphs-main.tar.gz?path=tensorflow_graphs/ESM/"
staticprivate

◆ model_name_

std::string protocols::esm_perplexity::EsmPerplexityTensorflowProtocol::model_name_

path to the model


The documentation for this class was generated from the following files: