ionFinder/src/peptide.cpp
PeptideNamespace::FragmentIon PeptideNamespace::FragmentIon::makeNLFrag(double lossMass,
																		size_t numNL) const
{
	PeptideNamespace::FragmentIon ret = FragmentIon(*this);
	
	//get new fragment type
	PeptideNamespace::IonType ionType;
	if(getBY() == 'b')
		ionType = PeptideNamespace::IonType::B_NL;
	else if(getBY() == 'y')
		ionType = PeptideNamespace::IonType::Y_NL;
	else if(getBY() == 'M' || getBY() == 'm')
		ionType = PeptideNamespace::IonType::M_NL;
	else throw std::runtime_error("Unknown ion type!");
	ret.setIonType(ionType);
	
	//add mass and nlMass
	ret.mass = mass - (lossMass / charge);
	ret._nlMass = -1 * lossMass;
	ret._numNl = numNL;

	return ret;
}
/**
 Create a new FragmentIon object with the corresponding \p lossMass neutral loss.
 
 \param lossMass Mass of neutral loss given as a positive number.
 \param numNL Multlipicity of neutral loss.
 \return New PeptideNamespace::FragmentIon with specified \p lossMass.
 */
Create a new FragmentIon object with the corresponding \p lossMass neutral loss.
\param lossMass Mass of neutral loss given as a positive number.
\param numNL Multlipicity of neutral loss.
\return New PeptideNamespace::FragmentIon with specified \p lossMass.
Create a new FragmentIon object with the corresponding \ p lossMass neutral loss . \ param lossMass Mass of neutral loss given as a positive number . \ param numNL Multlipicity of neutral loss . \ return New PeptideNamespace :: FragmentIon with specified \ p lossMass .
PeptideNamespace::FragmentIon PeptideNamespace::FragmentIon::makeNLFrag(double lossMass,
																		size_t numNL) const
{
	PeptideNamespace::FragmentIon ret = FragmentIon(*this);
	PeptideNamespace::IonType ionType;
	if(getBY() == 'b')
		ionType = PeptideNamespace::IonType::B_NL;
	else if(getBY() == 'y')
		ionType = PeptideNamespace::IonType::Y_NL;
	else if(getBY() == 'M' || getBY() == 'm')
		ionType = PeptideNamespace::IonType::M_NL;
	else throw std::runtime_error("Unknown ion type!");
	ret.setIonType(ionType);
	ret.mass = mass - (lossMass / charge);
	ret._nlMass = -1 * lossMass;
	ret._numNl = numNL;
	return ret;
}
PeptideNamespace :: FragmentIon PeptideNamespace :: FragmentIon :: makeNLFrag ( double lossMass , size_t numNL ) const { PeptideNamespace :: FragmentIon ret = FragmentIon ( * this ) ; PeptideNamespace :: IonType ionType ; if ( getBY ( ) == ' ' ) ionType = PeptideNamespace :: IonType :: B_NL ; else if ( getBY ( ) == ' ' ) ionType = PeptideNamespace :: IonType :: Y_NL ; else if ( getBY ( ) == ' ' || getBY ( ) == ' ' ) ionType = PeptideNamespace :: IonType :: M_NL ; else throw std :: runtime_error ( " " ) ; ret . setIonType ( ionType ) ; ret . mass = mass - ( lossMass / charge ) ; ret . _nlMass = -1 * lossMass ; ret . _numNl = numNL ; return ret ; }
Create a new FragmentIon object with the corresponding \p lossMass neutral loss.
Create a new FragmentIon object with the corresponding \ p lossMass neutral loss .
//get new fragment type //add mass and nlMass