]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/internal/SamFormatPrinter_p.cpp
Fixed regression: improper @SQ line ordering in SamHeader output
[bamtools.git] / src / api / internal / SamFormatPrinter_p.cpp
index a5b61a017bbdf4bcaa63d26b2e489a8078f31e5a..f9a118e5c9d5f6eb8e8beb96000e715c38b9c153 100644 (file)
@@ -2,7 +2,7 @@
 // SamFormatPrinter.cpp (c) 2010 Derek Barnett
 // Marth Lab, Department of Biology, Boston College
 // ---------------------------------------------------------------------------
-// Last modified: 12 October 2011 (DB)
+// Last modified: 14 October 2011 (DB)
 // ---------------------------------------------------------------------------
 // Provides functionality for printing formatted SAM header to string
 // ***************************************************************************
@@ -81,7 +81,7 @@ void SamFormatPrinter::PrintSQ(std::stringstream& out) const {
     SamSequenceConstIterator seqIter = m_header.Sequences.ConstBegin();
     SamSequenceConstIterator seqEnd  = m_header.Sequences.ConstEnd();
     for ( ; seqIter != seqEnd; ++seqIter ) {
-        const SamSequence& seq = seqIter->second;
+        const SamSequence& seq = (*seqIter);
 
         // @SQ SN:<Name> LN:<Length>
         out << Constants::SAM_SQ_BEGIN_TOKEN
@@ -115,7 +115,7 @@ void SamFormatPrinter::PrintRG(std::stringstream& out) const {
     SamReadGroupConstIterator rgIter = m_header.ReadGroups.ConstBegin();
     SamReadGroupConstIterator rgEnd  = m_header.ReadGroups.ConstEnd();
     for ( ; rgIter != rgEnd; ++rgIter ) {
-        const SamReadGroup& rg = rgIter->second;
+        const SamReadGroup& rg = (*rgIter);
 
         // @RG ID:<ID>
         out << Constants::SAM_RG_BEGIN_TOKEN