|
Rosetta
|
The FragmentLibrary implements a combinatorial library for reaction and reagent data. Its main task is to hold chemical information and provide new ligands. More...
#include <FragmentLibrary.hh>
Public Member Functions | |
| FragmentLibrary () | |
| ~FragmentLibrary () | |
| FragmentLibrary & | operator= (FragmentLibrary const &other)=delete |
| FragmentLibrary (FragmentLibrary const &other)=delete | |
| void | initialize_from_options (EvolutionOptionsOP options, core::Size external_scoring, core::Size rank) |
| void | set_pose (core::pose::PoseCOP pose) |
| Sets the internally used pose for ligand creation. More... | |
| core::pose::PoseOP | create_ligand_pose (LigandIdentifier const &id, bool create_rotamers, char ligand_chain) const |
| generates a smiles representation for the id and calls create_ligand_pose with smiles More... | |
| core::pose::PoseOP | create_ligand_pose (std::string const &smiles, bool create_rotamers, char ligand_chain) const |
| generates a new residue represented by a given ligand code and adds it to a detached copy of the internally saved pose object More... | |
| void | load_data (std::string const &reaction_file_path, std::string const &reagent_file_path, core::Size rank) |
| Loads smirks reaction file and all reagents in the same folder. More... | |
| void | load_smiles (std::string const &path_to_data) |
| Loads external smiles for later scoring from file. More... | |
| LigandIdentifier | random_ligand () const |
| Simple function to generate a completely random ligand. More... | |
| ReagentSimilarityList | get_similar_reagents (core::Size reagent_id, core::Size reaction_id, core::Size position) const |
| Searches for similar reagents within a given reaction and position. More... | |
| core::Size | reactions_size () const |
| Returns the number of reactions. More... | |
| core::Size | reagents_size () const |
| Returns the total number of reagents. More... | |
| core::Size | reagents_size (core::Size reaction_index) const |
| Returns the total number of reagents for the given reaction. More... | |
| core::Size | reagents_size (core::Size reaction_index, core::Size position) const |
| Returns the number of reagents at one specific position in the given reaction. More... | |
| core::Size | random_reaction () const |
| Returns a random reaction index weighted for size of possible molecules. More... | |
| core::Size | random_reaction (std::set< core::Size > const &exclude) const |
| Returns a random reaction that is not included in exclude weighted for size of possible molecules. More... | |
| std::string | reaction_id (core::Size reaction_id) const |
| Returns the id of this reaction. More... | |
| std::string | reagent_id (core::Size reagent_id) const |
| Returns the id of this reagent. More... | |
| std::string | run_reaction (LigandIdentifier const &identifier) const |
| Runs the reaction specified by the ligand identifier and returns the resulting rdkit molecule. More... | |
| std::string | identifier_to_smiles (LigandIdentifier const &identifier) const |
| Generates a new molecule with rdkit reaction and returns its smiles representation. More... | |
| core::Size | n_unscored_smiles () const |
| Returns the number of saved external smiles that should be scored. More... | |
| core::Size | max_positions () const |
| Returns the number of maximum positions for all reactions used. More... | |
| core::Size | reaction_positions (core::Size reaction_id) const |
| Returns for a given reaction the number of positions used. More... | |
| core::Size | reaction_name_to_index (std::string const &reaction_name) const |
| Returns the used reaction index for a given reaction name. Returns 0 if not found. More... | |
| core::Size | reagent_name_to_index (core::Size reaction_index, core::Size position, std::string const &reagent_name) const |
| Returns the index for a given reagent. Returns 0 if not found. More... | |
| std::shared_ptr< RDKit::SparseIntVect< unsigned int > > | calculate_fingerprint (LigandIdentifier const &id) |
| Calculates a RDKit Morgan fingerprint for a given ligand. Fingerprints are saved and can be retrieved quickly. More... | |
| core::Real | similarity (LigandIdentifier const &id1, LigandIdentifier const &id2) |
| Returns the Tanimoto Similarity based on RDKit Morgan fingerprints for two given ligands. The fingerprints are either calculated or retrieved if previously calculated. More... | |
Private Member Functions | |
| core::conformation::ResidueOP | create_ligand (std::string const &smiles, bool create_rotamers) const |
| LigandIdentifier is interpreted as [reaction, reagent1, reagent2]. More... | |
| void | load_reactions (std::string const &reaction_file_name) |
| utility function to load all reactions. More... | |
| void | load_reagents (std::string const &reagent_file_path) |
| utility function to load all reagents. Returns indices of newly added entries in reagents_ More... | |
| core::Size | generate_rotamers (core::chemical::MutableResidueType &new_ligand) const |
| Tries to generate rotamers and returns how many were generated. More... | |
| core::pose::PoseOP | create_pose (core::conformation::Residue &ligand, char ligand_chain) const |
| Takes a ligand and adds it to a detached copy of the internally saved pose object. More... | |
Private Attributes | |
| utility::vector1< ReagentOP > | reagents_ |
| List of all available reagents. More... | |
| utility::vector1< ReactionOP > | reactions_ |
| List of all available reactions. More... | |
| core::pose::PoseCOP | pose_ |
| Stores the original pose to dock all ligands in. More... | |
| numeric::random::WeightedSampler | weighted_sampler_ |
| Weighted sampler for random unbiased selection. More... | |
| utility::vector1< std::string > | smiles_ |
| Only used in benchmarking runs. Stores external molecules defined by smiles. More... | |
| std::map< std::string, core::Size > | reaction_name_to_index_ |
| Used during data loading to map reaction names to indices whilst loading reagents. More... | |
| core::Size | max_reagents_ = 0 |
| stores how many reagents are used at max for a reaction to set the correct length for ligand identifiers More... | |
| std::map< LigandIdentifier, std::shared_ptr< RDKit::SparseIntVect< unsigned int > > > | fingerprints_ |
| stores calculated fingerprints for quick references More... | |
The FragmentLibrary implements a combinatorial library for reaction and reagent data. Its main task is to hold chemical information and provide new ligands.
|
default |
|
default |
|
delete |
| std::shared_ptr< RDKit::SparseIntVect< unsigned int > > protocols::ligand_evolution::FragmentLibrary::calculate_fingerprint | ( | LigandIdentifier const & | id | ) |
Calculates a RDKit Morgan fingerprint for a given ligand. Fingerprints are saved and can be retrieved quickly.
References fingerprints_, and run_reaction().
Referenced by similarity().
|
private |
LigandIdentifier is interpreted as [reaction, reagent1, reagent2].
References core::chemical::rdkit::RDMolToRestype::generate_restype(), generate_rotamers(), core::chemical::ResidueType::make(), and protocols::TR().
Referenced by create_ligand_pose().
| core::pose::PoseOP protocols::ligand_evolution::FragmentLibrary::create_ligand_pose | ( | LigandIdentifier const & | id, |
| bool | create_rotamers, | ||
| char | ligand_chain | ||
| ) | const |
generates a smiles representation for the id and calls create_ligand_pose with smiles
References run_reaction(), smiles_, and protocols::TR().
Referenced by protocols::ligand_evolution::Scorer::create_pose().
| core::pose::PoseOP protocols::ligand_evolution::FragmentLibrary::create_ligand_pose | ( | std::string const & | smiles, |
| bool | create_rotamers, | ||
| char | ligand_chain | ||
| ) | const |
generates a new residue represented by a given ligand code and adds it to a detached copy of the internally saved pose object
References create_ligand(), create_pose(), and protocols::TR().
|
private |
Takes a ligand and adds it to a detached copy of the internally saved pose object.
References protocols::sewing::data_storage::ligand, pose_, and protocols::TR().
Referenced by create_ligand_pose().
|
private |
Tries to generate rotamers and returns how many were generated.
References core::chemical::MutableResidueType::all_atoms(), core::chemical::MutableResidueType::atom_name(), core::chemical::AtomRefMapping< FromRef, ToRef >::invalid_entry(), core::chemical::rdkit::RestypeToRDMol::Mol(), core::chemical::MutableResidueType::nchi(), core::chemical::ResidueTypeBase::rotamer_library_specification(), protocols::TR(), and core::chemical::rdkit::RestypeToRDMol::vd_to_index().
Referenced by create_ligand().
| ReagentSimilarityList protocols::ligand_evolution::FragmentLibrary::get_similar_reagents | ( | core::Size | reagent_id, |
| core::Size | reaction_id, | ||
| core::Size | position | ||
| ) | const |
Searches for similar reagents within a given reaction and position.
References core::pose::motif::a(), protocols::match::upstream::b, reaction_id(), reactions_, reagent_id(), reagents_, and similarity().
Referenced by protocols::ligand_evolution::Crossover::cross(), and protocols::ligand_evolution::Mutator::mutate().
| std::string protocols::ligand_evolution::FragmentLibrary::identifier_to_smiles | ( | LigandIdentifier const & | identifier | ) | const |
Generates a new molecule with rdkit reaction and returns its smiles representation.
References run_reaction(), and smiles_.
Referenced by protocols::ligand_evolution::Scorer::ligand_line(), and protocols::ligand_evolution::Scorer::save_external_scoring_results().
| void protocols::ligand_evolution::FragmentLibrary::initialize_from_options | ( | EvolutionOptionsOP | options, |
| core::Size | external_scoring, | ||
| core::Size | rank | ||
| ) |
References load_data(), load_smiles(), and set_pose().
Referenced by protocols::ligand_evolution::EvolutionManager::init().
| void protocols::ligand_evolution::FragmentLibrary::load_data | ( | std::string const & | reaction_file_path, |
| std::string const & | reagent_file_path, | ||
| core::Size | rank | ||
| ) |
Loads smirks reaction file and all reagents in the same folder.
References load_reactions(), load_reagents(), reactions_, reagents_, protocols::TR(), and weighted_sampler_.
Referenced by initialize_from_options().
|
private |
utility function to load all reactions.
References max_reagents_, reaction_name_to_index_, reactions_, and protocols::TR().
Referenced by load_data().
|
private |
utility function to load all reagents. Returns indices of newly added entries in reagents_
References reaction_name_to_index_, reactions_, reagents_, and protocols::TR().
Referenced by load_data().
| void protocols::ligand_evolution::FragmentLibrary::load_smiles | ( | std::string const & | path_to_data | ) |
Loads external smiles for later scoring from file.
References smiles_, and protocols::TR().
Referenced by initialize_from_options().
| core::Size protocols::ligand_evolution::FragmentLibrary::max_positions | ( | ) | const |
Returns the number of maximum positions for all reactions used.
References max_reagents_.
Referenced by protocols::ligand_evolution::EvolutionManager::init_workmanager(), protocols::ligand_evolution::Scorer::ligand_line(), protocols::ligand_evolution::Scorer::load_scores(), and protocols::ligand_evolution::Scorer::save_results().
| core::Size protocols::ligand_evolution::FragmentLibrary::n_unscored_smiles | ( | ) | const |
Returns the number of saved external smiles that should be scored.
References smiles_.
Referenced by protocols::ligand_evolution::EvolutionManager::external_scoring().
|
delete |
| LigandIdentifier protocols::ligand_evolution::FragmentLibrary::random_ligand | ( | ) | const |
Simple function to generate a completely random ligand.
References max_reagents_, random_reaction(), and reactions_.
Referenced by protocols::ligand_evolution::Population::add_random().
| core::Size protocols::ligand_evolution::FragmentLibrary::random_reaction | ( | ) | const |
Returns a random reaction index weighted for size of possible molecules.
References weighted_sampler_.
Referenced by protocols::ligand_evolution::Mutator::mutate(), and random_ligand().
| core::Size protocols::ligand_evolution::FragmentLibrary::random_reaction | ( | std::set< core::Size > const & | exclude | ) | const |
Returns a random reaction that is not included in exclude weighted for size of possible molecules.
References reactions_, and reactions_size().
| std::string protocols::ligand_evolution::FragmentLibrary::reaction_id | ( | core::Size | reaction_id | ) | const |
Returns the id of this reaction.
References reactions_.
Referenced by protocols::ligand_evolution::Scorer::check_memory(), get_similar_reagents(), protocols::ligand_evolution::Scorer::ligand_line(), and reaction_positions().
| core::Size protocols::ligand_evolution::FragmentLibrary::reaction_name_to_index | ( | std::string const & | reaction_name | ) | const |
Returns the used reaction index for a given reaction name. Returns 0 if not found.
References reaction_name_to_index_.
Referenced by protocols::ligand_evolution::Scorer::get_best_loaded().
| core::Size protocols::ligand_evolution::FragmentLibrary::reaction_positions | ( | core::Size | reaction_id | ) | const |
Returns for a given reaction the number of positions used.
References reaction_id(), and reactions_.
Referenced by protocols::ligand_evolution::Crossover::cross(), protocols::ligand_evolution::Scorer::ligand_line(), and protocols::ligand_evolution::Mutator::mutate().
| core::Size protocols::ligand_evolution::FragmentLibrary::reactions_size | ( | ) | const |
| std::string protocols::ligand_evolution::FragmentLibrary::reagent_id | ( | core::Size | reagent_id | ) | const |
Returns the id of this reagent.
References reagents_.
Referenced by protocols::ligand_evolution::Scorer::check_memory(), get_similar_reagents(), and protocols::ligand_evolution::Scorer::ligand_line().
| core::Size protocols::ligand_evolution::FragmentLibrary::reagent_name_to_index | ( | core::Size | reaction_index, |
| core::Size | position, | ||
| std::string const & | reagent_name | ||
| ) | const |
Returns the index for a given reagent. Returns 0 if not found.
References reactions_, and reagents_.
Referenced by protocols::ligand_evolution::Scorer::get_best_loaded().
| core::Size protocols::ligand_evolution::FragmentLibrary::reagents_size | ( | ) | const |
Returns the total number of reagents.
References reagents_.
Referenced by protocols::ligand_evolution::Mutator::mutate(), and reagents_size().
| core::Size protocols::ligand_evolution::FragmentLibrary::reagents_size | ( | core::Size | reaction_index | ) | const |
Returns the total number of reagents for the given reaction.
References reactions_, and reagents_size().
| core::Size protocols::ligand_evolution::FragmentLibrary::reagents_size | ( | core::Size | reaction_index, |
| core::Size | position | ||
| ) | const |
Returns the number of reagents at one specific position in the given reaction.
References reactions_.
| std::string protocols::ligand_evolution::FragmentLibrary::run_reaction | ( | LigandIdentifier const & | identifier | ) | const |
Runs the reaction specified by the ligand identifier and returns the resulting rdkit molecule.
References reactions_, reagents_, and protocols::TR().
Referenced by calculate_fingerprint(), create_ligand_pose(), and identifier_to_smiles().
| void protocols::ligand_evolution::FragmentLibrary::set_pose | ( | core::pose::PoseCOP | pose | ) |
Sets the internally used pose for ligand creation.
References pose_.
Referenced by initialize_from_options().
| core::Real protocols::ligand_evolution::FragmentLibrary::similarity | ( | LigandIdentifier const & | id1, |
| LigandIdentifier const & | id2 | ||
| ) |
Returns the Tanimoto Similarity based on RDKit Morgan fingerprints for two given ligands. The fingerprints are either calculated or retrieved if previously calculated.
References calculate_fingerprint().
Referenced by get_similar_reagents(), and protocols::ligand_evolution::Scorer::score_population().
|
private |
stores calculated fingerprints for quick references
Referenced by calculate_fingerprint().
|
private |
stores how many reagents are used at max for a reaction to set the correct length for ligand identifiers
Referenced by load_reactions(), max_positions(), and random_ligand().
|
private |
Stores the original pose to dock all ligands in.
Referenced by create_pose(), and set_pose().
|
private |
Used during data loading to map reaction names to indices whilst loading reagents.
Referenced by load_reactions(), load_reagents(), and reaction_name_to_index().
|
private |
List of all available reactions.
Referenced by get_similar_reagents(), load_data(), load_reactions(), load_reagents(), random_ligand(), random_reaction(), reaction_id(), reaction_positions(), reactions_size(), reagent_name_to_index(), reagents_size(), and run_reaction().
|
private |
List of all available reagents.
Referenced by get_similar_reagents(), load_data(), load_reagents(), reagent_id(), reagent_name_to_index(), reagents_size(), and run_reaction().
|
private |
Only used in benchmarking runs. Stores external molecules defined by smiles.
Referenced by create_ligand_pose(), identifier_to_smiles(), load_smiles(), and n_unscored_smiles().
|
private |
Weighted sampler for random unbiased selection.
Referenced by load_data(), and random_reaction().