/** ** Copyright (c) 2007-2009 Illumina, Inc. ** ** This software is covered by the "Illumina Genome Analyzer Software ** License Agreement" and the "Illumina Source Code License Agreement", ** and certain third party copyright/licenses, and any user of this ** source file is bound by the terms therein (see accompanying files ** Illumina_Genome_Analyzer_Software_License_Agreement.pdf and ** Illumina_Source_Code_License_Agreement.pdf and third party ** copyright/license notices). ** ** This file is part of the Consensus Assessment of Sequence And VAriation ** (CASAVA) software package. ** ** \file MatchDescriptor.cpp ** ** \brief Commonly used functions and definitions ** ** \author Richard Shaw **/ #include #include "alignment/MatchDescriptor.hh" /*****************************************************************************/ MatchDescriptor::MatchDescriptor(const std::string& refStr, const std::string& readStr) { assert(readStr.length() == refStr.length()); unsigned int matchRunLen(0); typedef std::string::const_iterator ChCIter; ChCIter readChCIter(readStr.begin()); for (ChCIter refChCIter(refStr.begin()); refChCIter != refStr.end(); ++refChCIter, ++readChCIter) { if (*readChCIter == *refChCIter) { ++matchRunLen; } else { if (matchRunLen != 0) { ostrm_ << matchRunLen; matchRunLen = 0; } ostrm_ << *refChCIter; } } if (matchRunLen != 0) { ostrm_ << matchRunLen; } } /*****************************************************************************/