| 232 | } |
| 233 | |
| 234 | void FASTAFile::writeNext(const FASTAEntry &protein) |
| 235 | { |
| 236 | outfile_ << ">" << protein.identifier << " " << protein.description << "\n"; |
| 237 | const String &tmp(protein.sequence); |
| 238 | |
| 239 | int chunks(tmp.size() / 80); // number of complete chunks |
| 240 | Size chunk_pos(0); |
| 241 | while (--chunks >= 0) |
| 242 | { |
| 243 | outfile_.write(&tmp[chunk_pos], 80); |
| 244 | outfile_ << "\n"; |
| 245 | chunk_pos += 80; |
| 246 | } |
| 247 | |
| 248 | if (tmp.size() > chunk_pos) |
| 249 | { |
| 250 | outfile_.write(&tmp[chunk_pos], tmp.size() - chunk_pos); |
| 251 | outfile_ << "\n"; |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | void FASTAFile::writeEnd() |
| 256 | { |