OpenMS
Loading...
Searching...
No Matches
RibonucleotideDB Class Referencefinal

Database of ribonucleotides (modified and unmodified) More...

#include <OpenMS/CHEMISTRY/RibonucleotideDB.h>

Collaboration diagram for RibonucleotideDB:
[legend]

Public Types

using ConstRibonucleotidePtr = const Ribonucleotide *
 
typedef std::vector< std::unique_ptr< Ribonucleotide > >::const_iterator ConstIterator
 const iterator type definition
 

Public Member Functions

 ~RibonucleotideDB ()=default
 destructor
 
 RibonucleotideDB (const RibonucleotideDB &other)=delete
 copy constructor not available
 
RibonucleotideDBoperator= (const RibonucleotideDB &other)=delete
 assignment operator not available
 
 RibonucleotideDB (std::vector< std::unique_ptr< RibonucleotideDataProvider > > providers)
 constructor that loads from the given data providers
 
ConstIterator begin () const
 Const iterator to beginning of database.
 
ConstIterator end () const
 Const iterator to end of database.
 
ConstRibonucleotidePtr getRibonucleotide (const std::string &code)
 Get a ribonucleotide by its code (short name)
 
ConstRibonucleotidePtr getRibonucleotidePrefix (const std::string &seq)
 Get the ribonucleotide with the longest code that matches a prefix of seq.
 
std::pair< ConstRibonucleotidePtr, ConstRibonucleotidePtrgetRibonucleotideAlternatives (const std::string &code)
 Get the alternatives for an ambiguous modification code.
 

Static Public Member Functions

static RibonucleotideDBgetInstance ()
 replacement for constructor (singleton pattern)
 

Protected Member Functions

 RibonucleotideDB ()
 default constructor
 

Protected Attributes

std::vector< std::unique_ptr< Ribonucleotide > > ribonucleotides_
 list of known (modified) nucleotides
 
std::unordered_map< std::string, Sizecode_map_
 mapping of codes (short names) to indexes into ribonucleotides_
 
std::map< std::string, std::pair< ConstRibonucleotidePtr, ConstRibonucleotidePtr > > ambiguity_map_
 mapping of ambiguity codes to the alternatives they represent
 
Size max_code_length_
 

Private Member Functions

void loadFromProviders_ (std::vector< std::unique_ptr< RibonucleotideDataProvider > > &providers)
 load ribonucleotides from the given data providers
 

Detailed Description

Database of ribonucleotides (modified and unmodified)

The information in this class comes primarily from the Modomics database (http://modomics.genesilico.pl/modifications/) and is read from a tab-separated text file in data/CHEMISTRY/Modomics.tsv. In addition, OpenMS-specific (as well as potentially user-supplied) modification definitions are read from the file data/CHEMISTRY/Custom_RNA_modifications.tsv.

Member Typedef Documentation

◆ ConstIterator

typedef std::vector<std::unique_ptr<Ribonucleotide>>::const_iterator ConstIterator

const iterator type definition

◆ ConstRibonucleotidePtr

Constructor & Destructor Documentation

◆ ~RibonucleotideDB()

~RibonucleotideDB ( )
default

destructor

◆ RibonucleotideDB() [1/3]

RibonucleotideDB ( const RibonucleotideDB other)
delete

copy constructor not available

◆ RibonucleotideDB() [2/3]

RibonucleotideDB ( std::vector< std::unique_ptr< RibonucleotideDataProvider > >  providers)
explicit

constructor that loads from the given data providers

◆ RibonucleotideDB() [3/3]

RibonucleotideDB ( )
protected

default constructor

Member Function Documentation

◆ begin()

ConstIterator begin ( ) const
inline

Const iterator to beginning of database.

◆ end()

ConstIterator end ( ) const
inline

Const iterator to end of database.

◆ getInstance()

static RibonucleotideDB * getInstance ( )
static

◆ getRibonucleotide()

ConstRibonucleotidePtr getRibonucleotide ( const std::string &  code)

Get a ribonucleotide by its code (short name)

Exceptions
Exception::ElementNotFoundif nothing was found

◆ getRibonucleotideAlternatives()

std::pair< ConstRibonucleotidePtr, ConstRibonucleotidePtr > getRibonucleotideAlternatives ( const std::string &  code)

Get the alternatives for an ambiguous modification code.

Exceptions
Exception::ElementNotFoundif nothing was found

◆ getRibonucleotidePrefix()

ConstRibonucleotidePtr getRibonucleotidePrefix ( const std::string &  seq)

Get the ribonucleotide with the longest code that matches a prefix of seq.

Exceptions
Exception::ElementNotFoundif nothing was found

◆ loadFromProviders_()

void loadFromProviders_ ( std::vector< std::unique_ptr< RibonucleotideDataProvider > > &  providers)
private

load ribonucleotides from the given data providers

◆ operator=()

RibonucleotideDB & operator= ( const RibonucleotideDB other)
delete

assignment operator not available

Member Data Documentation

◆ ambiguity_map_

std::map<std::string, std::pair<ConstRibonucleotidePtr, ConstRibonucleotidePtr> > ambiguity_map_
protected

mapping of ambiguity codes to the alternatives they represent

◆ code_map_

std::unordered_map<std::string, Size> code_map_
protected

mapping of codes (short names) to indexes into ribonucleotides_

◆ max_code_length_

Size max_code_length_
protected

◆ ribonucleotides_

std::vector<std::unique_ptr<Ribonucleotide> > ribonucleotides_
protected

list of known (modified) nucleotides