ionFinder/src/peptide.cpp
double PeptideNamespace::Peptide::parseStaticMod(size_t startIndex)
{
	//get index of parentheses close
	size_t end = sequence.find(')', startIndex);
	if(end == std::string::npos)
		throw std::runtime_error("Invalid peptide sequence: " + sequence);
	
	//get mass of modification
	double ret = std::stod(sequence.substr(startIndex + 1, end - 1));
	//erase modification from sequence
	sequence.erase(sequence.begin() + startIndex, sequence.begin() + end + 1);
	
	return ret;
}
/**
 \brief Parse explicit static modification from AminoAcid::sequence. <br>
 
 Modification enclosed with parentheses is removed from sequence.
 
 \param startIndex index at which mod begins.
 \return mass of modification.
 */
\brief Parse explicit static modification from AminoAcid::sequence. 
Modification enclosed with parentheses is removed from sequence.

\param startIndex index at which mod begins.
\return mass of modification.
\ brief Parse explicit static modification from AminoAcid :: sequence . Modification enclosed with parentheses is removed from sequence . \ param startIndex index at which mod begins . \ return mass of modification .
double PeptideNamespace::Peptide::parseStaticMod(size_t startIndex)
{
	size_t end = sequence.find(')', startIndex);
	if(end == std::string::npos)
		throw std::runtime_error("Invalid peptide sequence: " + sequence);
	double ret = std::stod(sequence.substr(startIndex + 1, end - 1));
	sequence.erase(sequence.begin() + startIndex, sequence.begin() + end + 1);
	return ret;
}
double PeptideNamespace :: Peptide :: parseStaticMod ( size_t startIndex ) { size_t end = sequence . find ( ' ' , startIndex ) ; if ( end == std :: string :: npos ) throw std :: runtime_error ( " " + sequence ) ; double ret = std :: stod ( sequence . substr ( startIndex + 1 , end - 1 ) ) ; sequence . erase ( sequence . begin ( ) + startIndex , sequence . begin ( ) + end + 1 ) ; return ret ; }
\brief Parse explicit static modification from AminoAcid::sequence.
\ brief Parse explicit static modification from AminoAcid :: sequence .
//get index of parentheses close //get mass of modification //erase modification from sequence