Class compound_factory
Defined in File compound.hpp
Class Documentation
-
class compound_factory
Use the compound_factory singleton instance to create compound objects.
Public Functions
-
void set_default_dictionary(const std::filesystem::path &inDictFile)
Set the default dictionary file to inDictFile.
-
void push_dictionary(const std::filesystem::path &inDictFile)
Override any previously loaded dictionary with inDictFile.
-
void push_dictionary(const file &file)
Override any previously loaded dictionary with the data in file.
Load the file file as a source for compound information. This may be e.g. a regular mmCIF file with extra files containing compound information.
Be carefull to remove the block again, best use cif::compound_source as a stack based object.
Note
experimental feature
-
void pop_dictionary()
Remove the last pushed dictionary.
-
bool is_known_peptide(const std::string &res_name) const
Return whether res_name is a valid and known peptide.
-
bool is_known_base(const std::string &res_name) const
Return whether res_name is a valid and known base.
-
bool is_peptide(std::string_view res_name) const
Return whether res_name is a peptide.
-
bool is_base(std::string_view res_name) const
Return whether res_name is a base.
-
bool is_std_peptide(std::string_view res_name) const
Return whether res_name is one of the standard peptides.
-
bool is_std_base(std::string_view res_name) const
Return whether res_name is one of the standard bases.
-
bool is_monomer(std::string_view res_name) const
Return whether res_name is a monomer (either base or peptide)
-
inline bool is_std_monomer(std::string_view res_name) const
Return whether res_name is one of the standard bases or peptides.
-
inline bool is_water(std::string_view res_name) const
-
const compound *create(std::string_view id)
Create the compound object for id.
This will create the compound instance for id if it doesn’t exist already. The result is owned by this factory and should not be deleted by the user.
- Parameters
id – The compound ID, a three letter code usually
- Returns
The compound, or nullptr if it could not be created (missing info)
-
~compound_factory()
-
void report_missing_compound(std::string_view compound_id)
Public Static Functions
-
static void init(bool useThreadLocalInstanceOnly)
Initialise a singleton instance.
If you have a multithreaded application and want to have different compounds in each thread (e.g. a web service processing user requests with different sets of compounds) you can set the useThreadLocalInstanceOnly flag to true.
-
static compound_factory &instance()
Return the singleton instance. If initialized with local threads, this is the instance for the current thread.
-
static void clear()
Delete and reset the singleton instance. If initialized with local threads, this is the instance for the current thread.
Public Static Attributes
- static CIFPP_EXPORT const std::map< std::string, char > kAAMap
Globally accessible static list of the default amino acids.
- static CIFPP_EXPORT const std::map< std::string, char > kBaseMap
Globally accessible static list of the default bases.
-
void set_default_dictionary(const std::filesystem::path &inDictFile)