int CMSPeak::Read(const CMSSpectrum& Spectrum, const CMSSearchSettings& Settings) { try { SetTolerance(Settings.GetMsmstol()); SetPrecursorTol(Settings.GetPeptol()); // note that there are two scales -- input scale and computational scale // Precursormz = MSSCALE * (Spectrum.GetPrecursormz()/(double)MSSCALE); // for now, we assume one scale Precursormz = Spectrum.GetPrecursormz(); const CMSSpectrum::TMz& Mz = Spectrum.GetMz(); const CMSSpectrum::TAbundance& Abundance = Spectrum.GetAbundance(); SetPeakLists()[eMSPeakListOriginal]->CreateLists(Mz.size()); int i; for (i = 0; i < SetPeakLists()[eMSPeakListOriginal]->GetNum(); i++) { // for now, we assume one scale SetPeakLists()[eMSPeakListOriginal]->GetMZI()[i].SetMZ() = Mz[i]; SetPeakLists()[eMSPeakListOriginal]->GetMZI()[i].SetIntensity() = Abundance[i]; } SetPeakLists()[eMSPeakListOriginal]->Sort(eMSPeakListSortMZ); } catch (NCBI_NS_STD::exception& e) { ERR_POST(Info << "Exception in CMSPeak::Read: " << e.what()); throw; } return 0; }
// Initialization Funciton void LINEAR_SOLVER::Initialize(const T& tolerance_input, const int& max_iteration_input, MULTITHREADING* multithreading_input) { multithreading = multithreading_input; max_iteration = max_iteration_input; SetTolerance(tolerance_input); }