예제 #1
0
void SAXMzxmlHandler::endElement(const XML_Char *el)
{
	if(isElement("peaks", el))
	{
		processData();
		m_bInPeaks = false;
	}
	else if(isElement("precursorMz", el))
	{
		processData();
		m_bInPrecursorMz = false;
	}
	else if(isElement("scan", el) && m_bInMsLevel2 == true)
	{
		// only add a spectrum without charge (which will lead
		// to internal xtandem charge state guessing) if there
		// were no values parsed from *both* "precursorCharge"
		// or "possibleCharges"
		if ( (m_precursorCharge == 0) && (m_viPossiblePrecursorCharges.size() == 0) ) {
		  // add spectrum, with precursorMz charge
		  pushSpectrum();
		}
		
		else {

		  // add the spectrum with the m_precursorCharge value
		  int originalPrecursorMZ = m_precursorCharge; // do other pushSpectrum calls change this?
		  pushSpectrum(m_precursorCharge);
		  
		  // are there any multiple precursor charges from mzXML 3.1's
		  // possibleCharges?
		  if (m_viPossiblePrecursorCharges.size() > 0) {
		    size_t originalId = m_tId;
		    for (vector<int>::iterator i = m_viPossiblePrecursorCharges.begin();
			 i != m_viPossiblePrecursorCharges.end();
			 ++i) {
		      int z = *i;
		      if (z != originalPrecursorMZ) { // no need to duplicate if already added
			m_tId += 100000000;
			pushSpectrum(z);
		      }
		    }
		    m_tId = originalId;
		  }
		}

		m_bInMsLevel2 = false;
	}
}
예제 #2
0
void SAXMzdataHandler::endElement(const XML_Char *el)
{
	if(isElement("mzArrayBinary", el))
		m_bInmzArrayBinary = false;
	else if(isElement("intenArrayBinary", el))
		m_bInintenArrayBinary = false;
	else if(isElement("data", el))
	{
		processData();
		m_bInData = false;
	}
	else if(isElement("spectrum", el) && m_bInMsLevel2)
	{
		pushSpectrum();
		m_bInMsLevel2 = false;
	}
}
예제 #3
0
void SAXMzmlHandler::endElement(const XML_Char *el)
{
	if(isElement("binary", el))	{
		processData();
		m_bInintenArrayBinary = false;
		m_bInmzArrayBinary = false;
		m_bInData = false;
	}
	else if(isElement("spectrum", el) && m_bInMsLevel2)
	{
		pushSpectrum();
		m_bInMsLevel2 = false;
	}
	else if (isElement("referenceableParamGroup", el))
	{
		m_bInRefGroup = false;
	}
}
예제 #4
0
void SAXMzxmlHandler::endElement(const XML_Char *el)
{
	if(isElement("peaks", el))
	{
		processData();
		m_bInPeaks = false;
	}
	else if(isElement("precursorMz", el))
	{
		processData();
		m_bInPrecursorMz = false;
	}
	else if(isElement("scan", el) && m_bInMsLevel2 == true)
	{
		pushSpectrum();
		m_bInMsLevel2 = false;
	}
}
예제 #5
0
void SAXGamlHandler::endElement(const XML_Char *el)
{
	if(isElement("note", el) && m_bDesc){
		m_bDesc=false;
	}
	else if(isElement("GAML:Xdata", el) && m_bInData){
		pushPeaks(m_bMZ, m_bINT);
		m_strData.clear();
		m_bMZ = false;
	}
	else if(isElement("GAML:Ydata", el) && m_bInData){
		pushPeaks(m_bMZ, m_bINT);
		m_strData.clear();
		m_bINT = false;
	}
	else if(isElement("GAML:trace", el) && m_bInData){
		pushSpectrum();
		reset();
		m_bInData=false;
	}
}