OpenMS  2.8.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RibonucleotideDB Class Reference

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< ConstRibonucleotidePtr >::const_iterator ConstIterator
 const iterator type definition More...
 

Public Member Functions

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

Static Public Member Functions

static RibonucleotideDBgetInstance ()
 replacement for constructor (singleton pattern) More...
 

Protected Member Functions

 RibonucleotideDB ()
 default constructor More...
 
void readFromFile_ (const std::string &path)
 read (modified) nucleotides from input file More...
 
ConstRibonucleotidePtr parseRow_ (const std::string &row, Size line_count)
 create a (modified) nucleotide from an input row More...
 

Protected Attributes

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

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<ConstRibonucleotidePtr>::const_iterator ConstIterator

const iterator type definition

◆ ConstRibonucleotidePtr

Constructor & Destructor Documentation

◆ ~RibonucleotideDB()

virtual ~RibonucleotideDB ( )
virtual

destructor

◆ RibonucleotideDB() [1/2]

RibonucleotideDB ( const RibonucleotideDB other)
delete

copy constructor not available

◆ RibonucleotideDB() [2/2]

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

◆ operator=()

RibonucleotideDB& operator= ( const RibonucleotideDB other)
delete

assignment operator not available

◆ parseRow_()

ConstRibonucleotidePtr parseRow_ ( const std::string &  row,
Size  line_count 
)
protected

create a (modified) nucleotide from an input row

◆ readFromFile_()

void readFromFile_ ( const std::string &  path)
protected

read (modified) nucleotides from input file

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<ConstRibonucleotidePtr> ribonucleotides_
protected

list of known (modified) nucleotides