40 #include <unordered_map>
57 typedef std::vector<std::unique_ptr<Ribonucleotide>>::const_iterator
ConstIterator;
74 return ribonucleotides_.begin();
80 return ribonucleotides_.end();
116 const std::unique_ptr<Ribonucleotide>
parseRow_(
const std::string& row,
Size line_count);
125 std::map<std::string, std::pair<ConstRibonucleotidePtr, ConstRibonucleotidePtr>>
ambiguity_map_;
Database of ribonucleotides (modified and unmodified)
Definition: RibonucleotideDB.h:52
RibonucleotideDB()
default constructor
static RibonucleotideDB * getInstance()
replacement for constructor (singleton pattern)
std::vector< std::unique_ptr< Ribonucleotide > > ribonucleotides_
list of known (modified) nucleotides
Definition: RibonucleotideDB.h:119
std::pair< ConstRibonucleotidePtr, ConstRibonucleotidePtr > getRibonucleotideAlternatives(const std::string &code)
Get the alternatives for an ambiguous modification code.
RibonucleotideDB & operator=(const RibonucleotideDB &other)=delete
assignment operator not available
RibonucleotideDB(const RibonucleotideDB &other)=delete
copy constructor not available
ConstRibonucleotidePtr getRibonucleotide(const std::string &code)
Get a ribonucleotide by its code (short name)
ConstIterator end() const
Const iterator to end of database.
Definition: RibonucleotideDB.h:78
std::vector< std::unique_ptr< Ribonucleotide > >::const_iterator ConstIterator
const iterator type definition
Definition: RibonucleotideDB.h:57
void readFromJSON_(const std::string &path)
read from a newer version of Modomics that uses a JSON file
std::unordered_map< std::string, Size > code_map_
mapping of codes (short names) to indexes into ribonucleotides_
Definition: RibonucleotideDB.h:122
const std::unique_ptr< Ribonucleotide > parseRow_(const std::string &row, Size line_count)
create a (modified) nucleotide from an input row
Size max_code_length_
Definition: RibonucleotideDB.h:127
ConstIterator begin() const
Const iterator to beginning of database.
Definition: RibonucleotideDB.h:72
ConstRibonucleotidePtr getRibonucleotidePrefix(const std::string &seq)
Get the ribonucleotide with the longest code that matches a prefix of seq.
void readFromFile_(const std::string &path)
read (modified) nucleotides from input file
std::map< std::string, std::pair< ConstRibonucleotidePtr, ConstRibonucleotidePtr > > ambiguity_map_
mapping of ambiguity codes to the alternatives they represent
Definition: RibonucleotideDB.h:125
~RibonucleotideDB()=default
destructor
Representation of a ribonucleotide (modified or unmodified)
Definition: Ribonucleotide.h:52
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48