annotate egglib/egglib-2.1.5/include/egglib-cpp/Fasta.hpp @ 1:420b57c3c185 draft

Uploaded
author dereeper
date Fri, 10 Jul 2015 04:39:30 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
1 /*
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
2 Copyright 2008-2009 Stéphane De Mita, Mathieu Siol
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
3
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
4 This file is part of the EggLib library.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
5
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
6 EggLib is free software: you can redistribute it and/or modify
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
8 the Free Software Foundation, either version 3 of the License, or
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
9 (at your option) any later version.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
10
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
11 EggLib is distributed in the hope that it will be useful,
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
14 GNU General Public License for more details.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
15
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
17 along with EggLib. If not, see <http://www.gnu.org/licenses/>.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
18 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
19
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
20 #ifndef EGGLIB_FASTA_HPP
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
21 #define EGGLIB_FASTA_HPP
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
22
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
23 #include <istream>
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
24 #include <iostream>
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
25 #include <string>
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
26 #include "Container.hpp"
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
27
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
28 namespace egglib {
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
29
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
30 /** \brief Fasta parser/formatted
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
31 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
32 * \ingroup core
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
33 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
34 * Reads a multifasta sequence file from a string, a stream or a file
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
35 * and returns a Container. See the description of the format below.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
36 * Formats a fasta string from a sequence container object and places
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
37 * it in a string, a stream of a file. All methods are static and the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
38 * class cannot be instantiated. The methods parsef and formatf will
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
39 * open the file for you while the others will read/write directly
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
40 * in a string.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
41 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
42 * Specifications of the fasta format:
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
43 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
44 * - The number of sequences is not limited.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
45 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
46 * - Each sequence is preceded by a header limited to a single
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
47 * line and starting by a ">" character.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
48 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
49 * - The header length is not limited and all characters are
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
50 * allowed but white spaces and special characters are
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
51 * discouraged.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
52 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
53 * - Group indices are specified by \@0, \@1, \@2... strings
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
54 * appearing at the end of the header string (just before the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
55 * carriage return). Note that group labels are ignored by
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
56 * default.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
57 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
58 * - Group indices are ignored unless specifically specified in a
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
59 * parser's options.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
60 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
61 * - The sequence itself continues on following lines until the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
62 * next ">" character or the end of the file.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
63 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
64 * - White spaces, tab and carriage returns are allowed at any
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
65 * position There is no limitation in length and different
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
66 * sequences can have different lengths.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
67 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
68 * - Although the standard is lower case characters, Fasta
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
69 * assumes upper case characters and only supports lower case
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
70 * characters (and converts them to upper case characters).
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
71 * Information coded by change in case is lost.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
72 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
73 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
74 class Fasta {
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
75
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
76 public:
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
77
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
78 /** \brief Imports a fasta file
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
79 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
80 * Imports the content of the file as is. Calls the method
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
81 * pase(std::istream*, bool) by creating its own istream.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
82 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
83 * \param fname the name of a fasta file.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
84 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
85 * \param importGroupLabels if set to true, scan automatically
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
86 * for groups. The format is @ followed by an integer, placed
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
87 * at the end of the header string(sequences without labels
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
88 * will be treated as \@0).
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
89 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
90 * \return A Container object containing the sequences.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
91 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
92 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
93 static Container parsef(const char* fname, bool importGroupLabels=false);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
94
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
95
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
96 /** \brief Imports a fasta file
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
97 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
98 * Imports the content of the file as is. Calls the method
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
99 * pase(std::istream*, bool) by creating its own istream. This
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
100 * method expects a reference to a Container to which the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
101 * sequences will be appended.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
102 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
103 * \param fname the name of a fasta file.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
104 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
105 * \param container a Container instance, empty or not.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
106 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
107 * \param importGroupLabels if set to true, scan automatically
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
108 * for groups. The format is @ followed by an integer, placed
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
109 * at the end of the header string(sequences without labels
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
110 * will be treated as \@0).
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
111 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
112 * \return Nothings: the new sequences are appended to the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
113 * Container passed as argument.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
114 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
115 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
116 static void parsef(const char* fname, Container& container, bool importGroupLabels=false);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
117
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
118
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
119 /** \brief Imports a fasta file
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
120 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
121 * Imports the content of the file as is. Calls the method
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
122 * pase(std::istream*, bool) by creating its own istream.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
123 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
124 * \param str a string containing the data.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
125 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
126 * \param importGroupLabels if set to true, scan automatically
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
127 * for groups. The format is @ followed by an integer, placed
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
128 * at the end of the header string(sequences without labels
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
129 * will be treated as \@0).
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
130 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
131 * \return A Container object containing the sequences.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
132 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
133 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
134 static Container parse(const std::string& str, bool importGroupLabels=false);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
135
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
136
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
137 /** \brief Imports a fasta file
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
138 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
139 * Imports the content of the file as is. Calls the method
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
140 * pase(std::istream*, bool) by creating its own istream. This
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
141 * method expects a reference to a Container to which the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
142 * sequences will be appended.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
143 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
144 * \param str a string containing the data.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
145 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
146 * \param container a Container instance, empty or not.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
147 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
148 * \param importGroupLabels if set to true, scan automatically
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
149 * for groups. The format is @ followed by an integer, placed
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
150 * at the end of the header string(sequences without labels
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
151 * will be treated as \@0).
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
152 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
153 * \return Nothing: new sequences are appended to the Container
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
154 * passed as argument.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
155 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
156 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
157 static void parse(const std::string& str, Container& container, bool importGroupLabels=false);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
158
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
159
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
160 /** \brief Imports a fasta file from an open stream
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
161 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
162 * Imports the content of the file as is.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
163 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
164 * \param stream an open stream (file or string) containing the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
165 * data.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
166 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
167 * \param importGroupLabels if set to true, scan automatically
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
168 * for groups. The format is @ followed by an integer, placed
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
169 * at the end of the header string(sequences without labels
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
170 * will be treated as \@0).
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
171 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
172 * \return A Container object containing the sequences.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
173 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
174 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
175 static Container parse(std::istream& stream, bool importGroupLabels=false);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
176
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
177
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
178 /** \brief Imports a fasta file from an open stream
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
179 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
180 * Imports the content of the file as is. This
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
181 * method expects a reference to a Container to which the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
182 * sequences will be appended.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
183 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
184 * \param stream an open stream (file or string) containing the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
185 * data.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
186 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
187 * \param container a Container instance, empty or not.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
188 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
189 * \param importGroupLabels if set to true, scan automatically
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
190 * for groups. The format is @ followed by an integer, placed
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
191 * at the end of the header string(sequences without labels
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
192 * will be treated as \@0).
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
193 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
194 * \return Nothing: the new sequences are appended to the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
195 * Container passed as argument.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
196 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
197 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
198 static void parse(std::istream& stream, Container& container, bool importGroupLabels=false);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
199
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
200
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
201 /** \brief Export sequences as fasta
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
202 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
203 * \param fname the name of the file where to place the result.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
204 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
205 * \param container Container object to export.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
206 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
207 * \param exportGroupLabels if set to true, exports group
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
208 * indices as a \@x at the end of the sequence name, where x is
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
209 * the group index. Otherwise, this information is discarded.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
210 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
211 * \param lineLength the number of characters to place on a
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
212 * single line. If zero, no newlines are inserted within
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
213 * sequences.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
214 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
215 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
216 static void formatf(const char* fname, const Container& container, bool exportGroupLabels=false, unsigned int lineLength=50);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
217
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
218
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
219 /** \brief Export sequences as fasta
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
220 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
221 * \param file an open stream.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
222 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
223 * \param container Container object to export.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
224 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
225 * \param exportGroupLabels if set to true, exports group
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
226 * indices as a \@x at the end of the sequence name, where x is
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
227 * the group index. Otherwise, this information is discarded.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
228 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
229 * \param lineLength the number of characters to place on a
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
230 * single line. If zero, no newlines are inserted within
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
231 * sequences.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
232 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
233 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
234 static void format(std::ostream& file, const Container& container, bool exportGroupLabels=false, unsigned int lineLength=50);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
235
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
236
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
237 /** \brief Export sequences as fasta
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
238 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
239 * This medod creates internally an ostringstream, calls the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
240 * method format(ostream, container, bool) and returns the
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
241 * resulting string.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
242 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
243 * \param container Container object to export.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
244 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
245 * \param exportGroupLabels if set to true, exports group
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
246 * indices as a \@x at the end of the sequence name, where x is
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
247 * the group index. Otherwise, this information is discarded.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
248 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
249 * \param lineLength the number of characters to place on a
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
250 * single line. If zero, no newlines are inserted within
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
251 * sequences.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
252 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
253 * \return The formatted string.
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
254 *
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
255 */
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
256 static std::string format(const Container& container, bool exportGroupLabels=false, unsigned int lineLength=50);
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
257
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
258
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
259
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
260 protected:
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
261
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
262 /// This class cannot be instantiated
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
263 Fasta() { }
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
264
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
265 /// This class cannot be instantiated
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
266 Fasta(const Fasta& source) { }
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
267
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
268 /// This class cannot be or copied
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
269 Fasta& operator=(const Fasta& source) { return *this; }
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
270
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
271 /// This class cannot be instantiated
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
272 virtual ~Fasta() { }
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
273
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
274
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
275 };
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
276 }
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
277
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
278 #endif