public void SetOptions(clsPeakProcessorParameters parameters) { _parameters = parameters; // the minimum intensity is not set till the actual data is available in DiscoverPeaks _peakProcessor.SetOptions(_parameters.SignalToNoiseThreshold, 0, _parameters.ThresholdedData, _parameters.PeakFitType); }
public clsPeakProcessor() { _peakProcessor = new PeakProcessor(); _parameters = new clsPeakProcessorParameters(); _peakProcessor.SetOptions(_parameters.SignalToNoiseThreshold, 0, false, _parameters.PeakFitType); ProfileType = enmProfileType.PROFILE; }
public clsPeakProcessorParameters Clone() { var newParams = new clsPeakProcessorParameters { SignalToNoiseThreshold = this.SignalToNoiseThreshold, PeakBackgroundRatio = this.PeakBackgroundRatio, PeakFitType = this.PeakFitType, }; newParams.ThresholdedData = ThresholdedData; return(newParams); }
public void fitterOnRapidDataTest1() { Run run = new XCaliburRun2(xcaliburTestfile); ResultCollection results = new ResultCollection(run); run.CurrentScanSet = new ScanSet(6067); bool isTicRequested = false; Task msGen = new GenericMSGenerator(1154, 1158, isTicRequested); msGen.Execute(results); DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(); detectorParams.PeakBackgroundRatio = 0.5; detectorParams.PeakFitType = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC; detectorParams.SignalToNoiseThreshold = 3; detectorParams.ThresholdedData = false; Task peakDetector = new DeconToolsPeakDetectorV2(detectorParams); peakDetector.Execute(results); Task decon = new RapidDeconvolutor(); decon.Execute(results); IsosResult result1 = results.ResultList[0]; double resolution = result1.IsotopicProfile.GetMZofMostAbundantPeak() / result1.IsotopicProfile.GetFWHM(); MercuryDistributionCreator distcreator = new MercuryDistributionCreator(); distcreator.CreateDistribution(result1.IsotopicProfile.MonoIsotopicMass, result1.IsotopicProfile.ChargeState, resolution); distcreator.OffsetDistribution(result1.IsotopicProfile); XYData theorXYData = distcreator.Data; // theorXYData.Display(); AreaFitter areafitter = new AreaFitter(); double fitval = areafitter.GetFit(theorXYData, run.XYData, 10); Console.WriteLine(result1.IsotopicProfile.Score + "\t" + fitval); Console.WriteLine((result1.IsotopicProfile.Score - fitval) / result1.IsotopicProfile.Score * 100); Assert.AreEqual(0.0207350903681061m, (decimal)fitval); }
public void WriteFile(string file_name, DeconToolsV2.Results.clsTransformResults results, Peaks.clsPeakProcessorParameters peak_parameters, HornTransform.clsHornTransformParameters transform_parameters) { using (var file = new StreamWriter(new FileStream(file_name, FileMode.Create, FileAccess.Write))) { // Write out descriptors. Some information is unavailable for now. // i.e. what is the start position of the peaks data block and // the transform data block. Fill in place holders for now. // Once the data is actually written out, we can return to the stream and // write it. float version_num = 1; file.Write("<Version>" + version_num + "</version>"); WritePeakParameters(file, peak_parameters); WriteTransformParameters(file, transform_parameters); WritePeaks(file, results); } }
private void WritePeakParameters(TextWriter file, Peaks.clsPeakProcessorParameters peak_parameters) { // In a wierd pseudo xml/raw file format, we will write out tags in text // but keep all the data in binary. // We will not use a specialized SAX parser because our vocabulary on the XML file // will not be increasing to a point where we actually want to go through the effort // of incorporating an XML parser with our binary data. if (peak_parameters != null) { file.Write("<PeakParameters>"); file.Write("<MinBackgroundRatio>" + peak_parameters.PeakBackgroundRatio + "</MinBackgroundRatio>"); file.Write("<PeakFitType>"); switch (peak_parameters.PeakFitType) { case Peaks.PEAK_FIT_TYPE.APEX: file.Write("APEX"); break; case Peaks.PEAK_FIT_TYPE.QUADRATIC: file.Write("QUADRATIC"); break; case Peaks.PEAK_FIT_TYPE.LORENTZIAN: file.Write("LORENTZIAN"); break; default: break; } file.Write("</PeakFitType>"); file.Write("<S2NThreshold>" + peak_parameters.SignalToNoiseThreshold + "</S2NThreshold>"); file.Write("</PeakParameters>"); } }
public void ReadFile(string file_name, DeconToolsV2.Results.clsTransformResults results, Peaks.clsPeakProcessorParameters peak_parameters, HornTransform.clsHornTransformParameters transform_parameters) { }