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
 
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
 
void readFromFile_ (const std::string &path)
 read (modified) nucleotides from input file
 
void readFromJSON_ (const std::string &path)
 read from a newer version of Modomics that uses a JSON file
 
const std::unique_ptr< RibonucleotideparseRow_ (const std::string &row, Size line_count)
 create a (modified) nucleotide from an input row
 

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_
 

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/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_()

const std::unique_ptr< Ribonucleotide > 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

◆ readFromJSON_()

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

read from a newer version of Modomics that uses a JSON 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<std::unique_ptr<Ribonucleotide> > ribonucleotides_
protected

list of known (modified) nucleotides