OpenMS  2.8.0
Public Member Functions | Static Public Member Functions | List of all members
CrossLinksDB Class Reference

#include <OpenMS/CHEMISTRY/CrossLinksDB.h>

Inheritance diagram for CrossLinksDB:
[legend]
Collaboration diagram for CrossLinksDB:
[legend]

Public Member Functions

void readFromOBOFile (const String &filename)
 Adds modifications from a given file in OBO format. More...
 
void getAllSearchModifications (std::vector< String > &modifications) const
 Collects all modifications that can be used for identification searches. More...
 
- Public Member Functions inherited from ModificationsDB
Size getNumberOfModifications () const
 Returns the number of modifications read from the unimod.xml file. More...
 
const ResidueModificationgetModification (Size index) const
 Returns the modification with the given index. note: out-of-bounds check is only performed in debug mode. More...
 
void searchModifications (std::set< const ResidueModification * > &mods, const String &mod_name, const String &residue="", ResidueModification::TermSpecificity term_spec=ResidueModification::NUMBER_OF_TERM_SPECIFICITY) const
 Collects all modifications which have the given name as synonym. More...
 
const ResidueModificationsearchModification (const ResidueModification &mod_in) const
 Returns a pointer to an exact match of the given modification if present in the DB. More...
 
const ResidueModificationsearchModificationsFast (const String &mod_name, bool &multiple_matches, const String &residue="", ResidueModification::TermSpecificity term_spec=ResidueModification::NUMBER_OF_TERM_SPECIFICITY) const
 Returns the modification which has the given name as synonym (fast version) More...
 
const ResidueModificationgetModification (const String &mod_name, const String &residue="", ResidueModification::TermSpecificity term_spec=ResidueModification::NUMBER_OF_TERM_SPECIFICITY) const
 Returns the modification with the given name. More...
 
bool has (const String &modification) const
 Returns true if the modification exists. More...
 
const ResidueModificationaddModification (std::unique_ptr< ResidueModification > new_mod)
 Add a new modification to ModificationsDB. If the modification already exists (based on its fullID) it is not added. More...
 
const ResidueModificationaddModification (const ResidueModification &new_mod)
 Add a new modification to ModificationsDB. If the modification already exists (based on its fullID) it is not added. A copy will be made on the heap and added to the ModificationsDB otherwise. More...
 
Size findModificationIndex (const String &mod_name) const
 Returns the index of the modification in the mods_ vector; a unique name must be given. More...
 
void searchModificationsByDiffMonoMass (std::vector< String > &mods, double mass, double max_error, const String &residue="", ResidueModification::TermSpecificity term_spec=ResidueModification::NUMBER_OF_TERM_SPECIFICITY)
 Collects all modifications with delta mass inside a tolerance window. More...
 
void searchModificationsByDiffMonoMass (std::vector< const ResidueModification * > &mods, double mass, double max_error, const String &residue="", ResidueModification::TermSpecificity term_spec=ResidueModification::NUMBER_OF_TERM_SPECIFICITY)
 
void searchModificationsByDiffMonoMassSorted (std::vector< String > &mods, double mass, double max_error, const String &residue="", ResidueModification::TermSpecificity term_spec=ResidueModification::NUMBER_OF_TERM_SPECIFICITY)
 Collects all modifications with delta mass inside a tolerance window and adds them sorted by mass difference. More...
 
void searchModificationsByDiffMonoMassSorted (std::vector< const ResidueModification * > &mods, double mass, double max_error, const String &residue="", ResidueModification::TermSpecificity term_spec=ResidueModification::NUMBER_OF_TERM_SPECIFICITY)
 
const ResidueModificationgetBestModificationByDiffMonoMass (double mass, double max_error, const String &residue="", ResidueModification::TermSpecificity term_spec=ResidueModification::NUMBER_OF_TERM_SPECIFICITY)
 Returns the best matching modification for the given delta mass and residue. More...
 
void getAllSearchModifications (std::vector< String > &modifications) const
 Collects all modifications that can be used for identification searches. More...
 
void writeTSV (const String &filename)
 Writes tab separated entries: FullId,FullName,Origin,AA,TerminusSpecificity,DiffMonoMass (including header) to TSV file. More...
 

Static Public Member Functions

static CrossLinksDBgetInstance ()
 Returns a pointer to the modifications DB (singleton) More...
 
- Static Public Member Functions inherited from ModificationsDB
static ModificationsDBgetInstance ()
 Returns a pointer to the modifications DB (singleton) More...
 
static ModificationsDBinitializeModificationsDB (OpenMS::String unimod_file="CHEMISTRY/unimod.xml", OpenMS::String psimod_file="CHEMISTRY/PSI-MOD.obo", OpenMS::String xlmod_file="CHEMISTRY/XLMOD.obo")
 Initializes the modification DB with non-default modification files (can only be done once) More...
 
static bool isInstantiated ()
 Check whether ModificationsDB was instantiated before. More...
 

Private Member Functions

Constructors and Destructors
 CrossLinksDB ()
 Default constructor. More...
 
 CrossLinksDB (const CrossLinksDB &residue_db)
 Copy constructor. More...
 
 ~CrossLinksDB () override
 Destructor. More...
 
Assignment
CrossLinksDBoperator= (const CrossLinksDB &aa)
 Assignment operator. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ModificationsDB
bool residuesMatch_ (const char residue, const ResidueModification *curr_mod) const
 Helper function to check if a residue matches the origin for a modification. More...
 
- Protected Attributes inherited from ModificationsDB
std::vector< ResidueModification * > mods_
 Stores the modifications. More...
 
std::unordered_map< String, std::set< const ResidueModification * > > modification_names_
 Stores the mappings of (unique) names to the modifications. More...
 
- Static Protected Attributes inherited from ModificationsDB
static bool is_instantiated_
 Stores whether ModificationsDB was instantiated before. More...
 

Constructor & Destructor Documentation

◆ CrossLinksDB() [1/2]

CrossLinksDB ( )
private

Default constructor.

◆ CrossLinksDB() [2/2]

CrossLinksDB ( const CrossLinksDB residue_db)
private

Copy constructor.

◆ ~CrossLinksDB()

~CrossLinksDB ( )
overrideprivate

Destructor.

Member Function Documentation

◆ getAllSearchModifications()

void getAllSearchModifications ( std::vector< String > &  modifications) const

Collects all modifications that can be used for identification searches.

◆ getInstance()

static CrossLinksDB* getInstance ( )
inlinestatic

Returns a pointer to the modifications DB (singleton)

◆ operator=()

CrossLinksDB& operator= ( const CrossLinksDB aa)
private

Assignment operator.

◆ readFromOBOFile()

void readFromOBOFile ( const String filename)

Adds modifications from a given file in OBO format.

Note
readFromOBOFile should be called in a single threaded context with no other threads accessing the CrossLinkDB
Exceptions
Exception::ParseErrorif the file cannot be parsed correctly