~ubuntu-branches/ubuntu/saucy/libbpp-seq/saucy-proposed

« back to all changes in this revision

Viewing changes to src/Bpp/Seq/Io/Stockholm.cpp

  • Committer: Package Import Robot
  • Author(s): Julien Dutheil
  • Date: 2013-03-05 14:31:00 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130305143100-2jox395vr1ghao46
Tags: 2.1.0-1
* 'omics' tools now in bpp-seq-omics
* Extended BppO support
* StateProperties renamed to AlphabetIndex

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 
52
52
/******************************************************************************/
53
53
 
54
 
void Stockholm::write(ostream& output, const SiteContainer& sc) const throw (Exception)
 
54
void Stockholm::writeAlignment(ostream& output, const SiteContainer& sc) const throw (Exception)
55
55
{
56
56
        if (!output)
57
 
    throw IOException("Stockholm::write: can't write to ostream output");
 
57
    throw IOException("Stockholm::writeAlignment: can't write to ostream output");
58
58
 
59
59
  output << "# STOCKHOLM 1.0" << endl; 
60
60
  // Loop for all general comments
61
 
  for (unsigned int i = 0; i < sc.getGeneralComments().size(); ++i)
 
61
  for (size_t i = 0; i < sc.getGeneralComments().size(); ++i)
62
62
  {
63
63
    output << "#=GF CC " << sc.getGeneralComments()[i] << endl;
64
64
  }
65
65
 
66
66
        // Main loop : for all sequences in vector container
67
67
        vector<string> names = sc.getSequencesNames();
68
 
  unsigned int maxSize = 0; 
 
68
  size_t maxSize = 0; 
69
69
  for(unsigned int i = 0; i < names.size(); ++i)
70
70
  {
71
71
    names[i] = TextTools::removeWhiteSpaces(names[i]);
72
72
    if (names[i].size() > maxSize) maxSize = names[i].size();
73
73
  }
74
74
  if (maxSize > 255) maxSize = 255;
75
 
  for (unsigned int i = 0; i < sc.getNumberOfSequences(); ++i)
 
75
  for (size_t i = 0; i < sc.getNumberOfSequences(); ++i)
76
76
  {
77
77
    output << TextTools::resizeRight(names[i], maxSize) << " " << sc.getSequence(i).toString() << endl;
78
78
        }