A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
codes.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_SEQUENCE_FUNCTIONS_CODES_H_
2 #define GENESIS_SEQUENCE_FUNCTIONS_CODES_H_
3 
4 /*
5  Genesis - A toolkit for working with phylogenetic data.
6  Copyright (C) 2014-2017 Lucas Czech
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21  Contact:
22  Lucas Czech <lucas.czech@h-its.org>
23  Exelixis Lab, Heidelberg Institute for Theoretical Studies
24  Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
25 */
26 
34 #include <map>
35 #include <string>
36 
37 // =================================================================================================
38 // Forward Declarations
39 // =================================================================================================
40 
41 namespace genesis {
42 namespace utils {
43 
44  class Color;
45 
46 }
47 }
48 
49 namespace genesis {
50 namespace sequence {
51 
52 // =================================================================================================
53 // Codes
54 // =================================================================================================
55 
56 // ---------------------------------------------------------------------
57 // Nucleic Acids
58 // ---------------------------------------------------------------------
59 
63 std::string nucleic_acid_codes_plain();
64 
68 std::string nucleic_acid_codes_degenerated();
69 
74 
78 std::string nucleic_acid_codes_all();
79 
80 // ---------------------------------------------------------------------
81 // Amino Acids
82 // ---------------------------------------------------------------------
83 
87 std::string amino_acid_codes_plain();
88 
92 std::string amino_acid_codes_degenerated();
93 
97 std::string amino_acid_codes_undetermined();
98 
102 std::string amino_acid_codes_all();
103 
104 // ---------------------------------------------------------------------
105 // Misc
106 // ---------------------------------------------------------------------
107 
115 std::string normalize_codes( std::string const& alphabet );
116 
117 // =================================================================================================
118 // Color Codes
119 // =================================================================================================
120 
127 std::map<char, std::string> nucleic_acid_text_colors();
128 
135 std::map<char, std::string> amino_acid_text_colors();
136 
142 std::map<char, utils::Color> nucleic_acid_colors();
143 
149 std::map<char, utils::Color> amino_acid_colors();
150 
151 // =================================================================================================
152 // Code Names
153 // =================================================================================================
154 
185 std::string nucleic_acid_name( char code );
186 
225 std::string amino_acid_name( char code );
226 
264 std::string nucleic_acid_ambiguities( char code );
265 
297 char nucleic_acid_ambiguity_code( std::string codes );
298 
299 } // namespace sequence
300 } // namespace genesis
301 
302 #endif // include guard
std::string amino_acid_codes_all()
Return all valid amino acid codes. Those are "ACDEFGHIKLMNOPQRSTUVWYBJZX*-?".
Definition: codes.cpp:334
std::string amino_acid_codes_degenerated()
Return all degenerated amino acid codes. Those are "BJZ".
Definition: codes.cpp:324
std::string amino_acid_codes_plain()
Return all plain amino acid codes. Those are "ACDEFGHIKLMNOPQRSTUVWY".
Definition: codes.cpp:319
std::string nucleic_acid_codes_all()
Return all valid nucleic acid codes. Those are "ACGTUWSMKRYBDHVNOX.-?".
Definition: codes.cpp:308
std::string nucleic_acid_name(char code)
Get the name of a nucleic acid given its IUPAC code.
Definition: codes.cpp:382
std::string nucleic_acid_codes_plain()
Return all plain nucleic acid codes. Those are "ACGTU".
Definition: codes.cpp:293
std::string normalize_codes(std::string const &alphabet)
Normalize a set of Sequence codes, i.e., make them upper case, sort them, and remove duplicates...
Definition: codes.cpp:345
std::string nucleic_acid_codes_degenerated()
Return all degenerated nucleic acid codes. Those are "WSMKRYBDHV".
Definition: codes.cpp:298
std::string nucleic_acid_codes_undetermined()
Return all undetermined nucleic acid codes. Those are "NOX.-?".
Definition: codes.cpp:303
std::map< char, std::string > nucleic_acid_text_colors()
Return a map of text colors for each nucleic acid code.
Definition: codes.cpp:358
std::string amino_acid_name(char code)
Get the name of a amino acid given its IUPAC code.
Definition: codes.cpp:391
std::map< char, utils::Color > amino_acid_colors()
Return a map of Colors for each amino acid code.
Definition: codes.cpp:373
std::map< char, std::string > amino_acid_text_colors()
Return a map of text colors for each amino acid code.
Definition: codes.cpp:363
std::string nucleic_acid_ambiguities(char code)
Return the possible ambiguous nucleic acid codes for a given code char.
Definition: codes.cpp:400
std::string amino_acid_codes_undetermined()
Return all undetermined amino acid codes. Those are "X*-?".
Definition: codes.cpp:329
std::map< char, utils::Color > nucleic_acid_colors()
Return a map of Colors for each nucleic acid code.
Definition: codes.cpp:368
char nucleic_acid_ambiguity_code(std::string codes)
Return the nucleic acid code that represents all given codes.
Definition: codes.cpp:409