public void createTextFileRunTest1() { var rf = new RunFactory(); var run = rf.CreateRun(textFile1); Assert.AreEqual(Globals.MSFileType.Ascii, run.MSFileType); }
public void createIMSScanSets2() { var factory = new RunFactory(); var run = (UIMFRun)factory.CreateRun(FileRefs.RawDataMSFiles.UIMFStdFile3); var numScansSummed = 7; run.IMSScanSetCollection.Create(run, numScansSummed, 1); Assert.IsNotNull(run.IMSScanSetCollection); //tests the lowest ims_scans Assert.AreEqual(360, run.IMSScanSetCollection.ScanSetList.Count); Assert.AreEqual(4, run.IMSScanSetCollection.ScanSetList[0].IndexValues.Count); Assert.AreEqual(0, run.IMSScanSetCollection.ScanSetList[0].IndexValues[0]); Assert.AreEqual(3, run.IMSScanSetCollection.ScanSetList[0].IndexValues[3]); var testIMSScan2 = 100; Assert.AreEqual(7, run.IMSScanSetCollection.ScanSetList[testIMSScan2].IndexValues.Count); Assert.AreEqual(100, run.IMSScanSetCollection.ScanSetList[testIMSScan2].IndexValues[3]); Assert.AreEqual(100, run.IMSScanSetCollection.ScanSetList[testIMSScan2].PrimaryScanNumber); }
public void UIMFTest1() { var uimffile = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\UIMF\Sarc_P09_B06_0786_20Jul11_Cheetah_11-05-31.uimf"; var rf = new RunFactory(); var run = rf.CreateRun(uimffile); var expectedPeaksFile = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\UIMF\Sarc_P09_B06_0786_20Jul11_Cheetah_11-05-31_peaks.txt"; if (File.Exists(expectedPeaksFile)) { File.Delete(expectedPeaksFile); } var parameters = new PeakDetectAndExportWorkflowParameters(); parameters.LCScanMin = 500; parameters.LCScanMax = 510; parameters.NumIMSScansSummed = -1; var workflow = new PeakDetectAndExportWorkflow(run, parameters); workflow.Execute(); Assert.IsTrue(File.Exists(expectedPeaksFile)); }
public void createAgilentDRunTest1() { var rf = new RunFactory(); var run = rf.CreateRun(FileRefs.RawDataMSFiles.AgilentDFile1); Assert.AreEqual(Globals.MSFileType.Agilent_D, run.MSFileType); }
public void Import_NET_And_MassAlignment_Test1() { string mzAlignmentInfoFilename = Path.Combine(FileRefs.OutputFolderPath, "QC_Shew_08_04-pt5-2_11Jan09_Sphinx_08-11-18_MZAlignment.txt"); string NETAlignmentInfoFilename = Path.Combine(FileRefs.OutputFolderPath, "QC_Shew_08_04-pt5-2_11Jan09_Sphinx_08-11-18_ScanNetAlignment.txt"); RunFactory rf = new RunFactory(); Run run = rf.CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1); MassAlignmentInfoFromTextImporter importer = new MassAlignmentInfoFromTextImporter(mzAlignmentInfoFilename); run.AlignmentInfo = importer.Import(); NETAlignmentFromTextImporter netAlignmentInfoImporter = new NETAlignmentFromTextImporter(NETAlignmentInfoFilename); netAlignmentInfoImporter.ImportIntoAlignmentInfo(run.AlignmentInfo); //this will append the NET alignment info to the AlignmentInfo object float testScan = 6439; float testMZ = 698.875137f; //QCSHEW massTag 37003; m/z 698.875137 (2+) See Redmine issue 627: http://redmine.pnl.gov/issues/627 float ppmshift = run.AlignmentInfo.GetPPMShiftFromTimeMZ(testScan, testMZ); Console.WriteLine("ppm shift = " + ppmshift); float testScan2 = 6005; float testNET1 = run.AlignmentInfo.GetNETFromTime(testScan2); Assert.AreEqual(0.3253423m, (decimal)testNET1); Assert.AreEqual(-4.3, (decimal)Math.Round(ppmshift, 1)); }
public void creatorTest_ensureOnlyMS1_test1() { //note that frame 26 is a calibration frame. So we don't want to have this if we are summing frames var rf = new RunFactory(); var run = rf.CreateRun(FileRefs.RawDataMSFiles.UIMFStdFile4); //Sarc_P09_B06_0786_20Jul11_Cheetah_11-05-31.uimf var frameStart = 24; var frameStop = 28; var numFramesToSum = 3; var uimfRun = (UIMFRun)run; uimfRun.ScanSetCollection.Create(uimfRun, frameStart, frameStop, numFramesToSum, 1); Assert.AreEqual(4, uimfRun.ScanSetCollection.ScanSetList.Count); Assert.AreEqual("25 {24, 25, 27}", uimfRun.ScanSetCollection.ScanSetList[1].ToString()); //FrameSet testFrame0 = uimfRun.ScanSetCollection.ScanSetList[1]; //Assert.AreEqual(3, testFrame0.IndexValues.Count); //Assert.AreEqual(1, testFrame0.IndexValues[0]); }
public void createRunAndReadMSSpectraTest1() { //Create the run var runFactory = new RunFactory(); var run = runFactory.CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1); //Create the task var msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); //Create the target scan list (MS1 scans from 6005 - 6020). run.ScanSetCollection.Create(run, 6005, 6020, 1, 1); //iterate over each scan in the target collection get the mass spectrum foreach (var scan in run.ScanSetCollection.ScanSetList) { Console.WriteLine("Working on Scan " + scan.PrimaryScanNumber); run.CurrentScanSet = scan; msgen.Execute(run.ResultCollection); Console.WriteLine("XYPair count = " + run.XYData.Xvalues.Length); } }
public void Import_NET_And_MassAlignment_Test1() { var mzAlignmentInfoFilename = Path.Combine(FileRefs.ImportedData, "QC_Shew_08_04-pt5-2_11Jan09_Sphinx_08-11-18_MZAlignment.txt"); var NETAlignmentInfoFilename = Path.Combine(FileRefs.ImportedData, "QC_Shew_08_04-pt5-2_11Jan09_Sphinx_08-11-18_ScanNetAlignment.txt"); var rf = new RunFactory(); var run = rf.CreateRun(DeconTools.UnitTesting2.FileRefs.RawDataMSFiles.OrbitrapStdFile1); var importer = new MassAlignmentInfoFromTextImporter(mzAlignmentInfoFilename); var massAlignmentData = importer.Import(); var massAlignmentInfo = new MassAlignmentInfoLcmsWarp(); massAlignmentInfo.SetMassAlignmentData(massAlignmentData); run.MassAlignmentInfo = massAlignmentInfo; var netAlignmentInfoImporter = new NETAlignmentFromTextImporter(NETAlignmentInfoFilename); var scanNETdata = netAlignmentInfoImporter.Import(); run.NetAlignmentInfo.SetScanToNETAlignmentData(scanNETdata); float testScan = 6439; var testMZ = 698.875137f; //QCSHEW massTag 37003; m/z 698.875137 (2+) See Redmine issue 627: http://redmine.pnl.gov/issues/627 var ppmshift = run.MassAlignmentInfo.GetPpmShift(testMZ, (int)testScan); Console.WriteLine("ppm shift = " + ppmshift); var testScan2 = 6005; var testNET1 = run.NetAlignmentInfo.GetNETValueForScan(testScan2); Assert.AreEqual(0.3252918m, (decimal)Math.Round(testNET1, 7)); Assert.AreEqual(-4.3, (decimal)Math.Round(ppmshift, 1)); }
public void checkRetrievalOfScanValueForAGivenNET() { var NETAlignmentInfoFilename = Path.Combine(FileRefs.ImportedData, "QC_Shew_08_04-pt5-2_11Jan09_Sphinx_08-11-18_ScanNetAlignment.txt"); var rf = new RunFactory(); var run = rf.CreateRun(DeconTools.UnitTesting2.FileRefs.RawDataMSFiles.OrbitrapStdFile1); var netAlignmentInfoImporter = new NETAlignmentFromTextImporter(NETAlignmentInfoFilename); var scanNETdata = netAlignmentInfoImporter.Import(); run.NetAlignmentInfo.SetScanToNETAlignmentData(scanNETdata); var testNET1 = 0.95f; var testNET2 = 0.08f; var scan1 = (int)run.NetAlignmentInfo.GetScanForNet(testNET1); var scan2 = (int)run.NetAlignmentInfo.GetScanForNet(testNET2); Assert.AreEqual(18231, scan1); Assert.AreEqual(1113, scan2); //foreach (var item in scanNETdata) //{ // Console.WriteLine(item); //} //Console.WriteLine(); //Console.WriteLine(); //Console.WriteLine(scan1 + " was returned for NET= " + testNET1); }
public void getMSMSDataTest1() { //Create the run var runFactory = new RunFactory(); var run = runFactory.CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1); //Create the task Task msgen = MSGeneratorFactory.CreateMSGenerator(run.MSFileType); var peakdetector = new DeconToolsPeakDetectorV2(); var startScan = 6000; var stopScan = 7000; for (var i = startScan; i < stopScan; i++) { if (run.GetMSLevel(i) == 2) { var scanset = new ScanSet(i); run.CurrentScanSet = scanset; msgen.Execute(run.ResultCollection); peakdetector.Execute(run.ResultCollection); Console.Write("Working on Scan " + scanset.PrimaryScanNumber); Console.WriteLine("; XYPair count = " + run.XYData.Xvalues.Length); Console.WriteLine("num peaks= " + run.PeakList.Count); } } }
public void ImportMassAndTimePPMCorrections_and_Try_Alignment_Test1() { var importFilename = Path.Combine(FileRefs.ImportedData, "QC_Shew_08_04-pt5-2_11Jan09_Sphinx_08-11-18_MZAlignment.txt"); var rf = new RunFactory(); var run = rf.CreateRun(DeconTools.UnitTesting2.FileRefs.RawDataMSFiles.OrbitrapStdFile1); var importer = new MassAlignmentInfoFromTextImporter(importFilename); var massAlignmentData = importer.Import(); var massAlignmentInfo = new MassAlignmentInfoLcmsWarp(); massAlignmentInfo.SetMassAlignmentData(massAlignmentData); run.MassAlignmentInfo = massAlignmentInfo; float testScan = 6439; var testMZ = 698.875137f; //QCSHEW massTag 37003; m/z 698.875137 (2+) See Redmine issue 627: http://redmine.pnl.gov/issues/627 var ppmshift = run.MassAlignmentInfo.GetPpmShift(testMZ, (int)testScan); Console.WriteLine("ppm shift = " + ppmshift); Assert.AreEqual(-4.3, (decimal)Math.Round(ppmshift, 1)); }
public void creator_endFramesTest1() { var rf = new RunFactory(); var run = rf.CreateRun(FileRefs.RawDataMSFiles.UIMFStdFile3); var frameStop = ((UIMFRun)run).MaxLCScan; var frameStart = frameStop - 10; var uimfrun = (UIMFRun)run; uimfrun.ScanSetCollection.Create(uimfrun, frameStart, frameStop, 3, 1); Assert.AreEqual(11, uimfrun.ScanSetCollection.ScanSetList.Count); foreach (var frameset in uimfrun.ScanSetCollection.ScanSetList) { Console.WriteLine(frameset); } var testFrame0 = uimfrun.ScanSetCollection.ScanSetList[0]; Assert.AreEqual(3, testFrame0.IndexValues.Count); Assert.AreEqual(1164, testFrame0.IndexValues[0]); Assert.AreEqual(1165, testFrame0.IndexValues[1]); Assert.AreEqual(1166, testFrame0.IndexValues[2]); }
public void ExportNET_andMass_AlignmentDataTest1() { var exportNETFilename = Path.Combine(FileRefs.OutputFolderPath, "exportedNETAlignmentInfo1.txt"); var exportMassFilename = Path.Combine(FileRefs.OutputFolderPath, "exportedMassAlignmentInfo1.txt"); var rf = new RunFactory(); var run = rf.CreateRun(DeconTools.UnitTesting2.FileRefs.RawDataMSFiles.OrbitrapStdFile1); var deconToolsResultFile = Path.Combine(FileRefs.ImportedData, "QC_Shew_08_04-pt5-2_11Jan09_Sphinx_08-11-18_targetedFeatures.txt"); var importer = new UnlabelledTargetedResultFromTextImporter(deconToolsResultFile); var repo = importer.Import(); var massTagFile = @"\\protoapps\UserData\Slysz\Data\MassTags\qcshew_standard_file_allMassTags.txt"; var mtc = new TargetCollection(); var mtimporter = new MassTagFromTextFileImporter(massTagFile); mtc = mtimporter.Import(); var aligner = new NETAndMassAligner(); aligner.SetFeaturesToBeAligned(repo.Results); aligner.SetReferenceMassTags(mtc.TargetList); aligner.Execute(run); var exporter = new NETAlignmentInfoToTextExporter(exportNETFilename); exporter.ExportAlignmentInfo(run.AlignmentInfo); var massInfoexporter = new MassAlignmentInfoToTextExporter(exportMassFilename); massInfoexporter.ExportAlignmentInfo(run.AlignmentInfo); }
public void doAlignmentTest1() { RunFactory rf = new RunFactory(); Run run = rf.CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1); string deconToolsResultFile = @"D:\Temp\output7\targetedFeatures.txt"; UnlabelledTargetedResultFromTextImporter importer = new UnlabelledTargetedResultFromTextImporter(deconToolsResultFile); TargetedResultRepository repo = importer.Import(); string massTagFile = @"\\protoapps\UserData\Slysz\Data\MassTags\qcshew_standard_file_allMassTags.txt"; MassTagCollection mtc = new MassTagCollection(); MassTagFromTextFileImporter mtimporter = new MassTagFromTextFileImporter(massTagFile); mtc = mtimporter.Import(); NETAndMassAligner aligner = new NETAndMassAligner(); aligner.SetFeaturesToBeAligned(repo.Results); aligner.SetReferenceMassTags(mtc.MassTagList); aligner.Execute(run); Assert.IsNotNull(run.AlignmentInfo); Assert.IsNotNull(run.AlignmentInfo.marrNETFncTimeInput); Assert.AreEqual(2273.0f, run.AlignmentInfo.marrNETFncTimeInput[0]); float testScan = 6005; float testNET1 = run.AlignmentInfo.GetNETFromTime(testScan); Assert.AreEqual(0.3253423m, (decimal)testNET1); }
public void ExportNET_andMass_AlignmentDataTest1() { string exportNETFilename = Path.Combine(FileRefs.OutputFolderPath, "exportedNETAlignmentInfo1.txt"); string exportMassFilename = Path.Combine(FileRefs.OutputFolderPath, "exportedMassAlignmentInfo1.txt"); RunFactory rf = new RunFactory(); Run run = rf.CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1); string deconToolsResultFile = @"D:\Temp\output7\targetedFeatures.txt"; UnlabelledTargetedResultFromTextImporter importer = new UnlabelledTargetedResultFromTextImporter(deconToolsResultFile); TargetedResultRepository repo = importer.Import(); string massTagFile = @"\\protoapps\UserData\Slysz\Data\MassTags\qcshew_standard_file_allMassTags.txt"; MassTagCollection mtc = new MassTagCollection(); MassTagFromTextFileImporter mtimporter = new MassTagFromTextFileImporter(massTagFile); mtc = mtimporter.Import(); NETAndMassAligner aligner = new NETAndMassAligner(); aligner.SetFeaturesToBeAligned(repo.Results); aligner.SetReferenceMassTags(mtc.MassTagList); aligner.Execute(run); NETAlignmentInfoToTextExporter exporter = new NETAlignmentInfoToTextExporter(exportNETFilename); exporter.ExportAlignmentInfo(run.AlignmentInfo); MassAlignmentInfoToTextExporter massInfoexporter = new MassAlignmentInfoToTextExporter(exportMassFilename); massInfoexporter.ExportAlignmentInfo(run.AlignmentInfo); }
public void creatorTest_sum7_test1() { var rf = new RunFactory(); var run = rf.CreateRun(FileRefs.RawDataMSFiles.UIMFStdFile3); var frameStart = 1; var frameStop = 11; var numFramesToSum = 7; var uimfRun = (UIMFRun)run; uimfRun.ScanSetCollection.Create(uimfRun, frameStart, frameStop, numFramesToSum, 1); Assert.AreEqual(11, uimfRun.ScanSetCollection.ScanSetList.Count); foreach (var frameset in uimfRun.ScanSetCollection.ScanSetList) { Console.WriteLine(frameset); } var testFrame0 = uimfRun.ScanSetCollection.ScanSetList[3]; Assert.AreEqual(1, testFrame0.IndexValues.First()); Assert.AreEqual(7, testFrame0.IndexValues.Count); Assert.AreEqual(7, testFrame0.IndexValues.Last()); }
public void agilentDeconTest1() { RunFactory runFact = new RunFactory(); Run run = runFact.CreateRun(agilentFile); MSGeneratorFactory msfactory = new MSGeneratorFactory(); Task msgen = msfactory.CreateMSGenerator(run.MSFileType); DeconToolsPeakDetector peakDet = new DeconToolsPeakDetector(); peakDet.PeakBackgroundRatio = 7; peakDet.SigNoiseThreshold = 3; HornDeconvolutor decon = new HornDeconvolutor(); ScanSet scan1821 = new ScanSet(1821); run.CurrentScanSet = scan1821; msgen.Execute(run.ResultCollection); run.XYData = run.XYData.TrimData(450, 520, TODO); peakDet.Execute(run.ResultCollection); decon.Execute(run.ResultCollection); TestUtilities.DisplayMSFeatures(run.ResultCollection.ResultList); }
public void peakexporterTest1() { var rf = new RunFactory(); var run = rf.CreateRun(DeconTools.UnitTesting2.FileRefs.RawDataMSFiles.OrbitrapStdFile1); var parameters = new PeakDetectAndExportWorkflowParameters(); parameters.LCScanMin = 5500; parameters.LCScanMax = 6500; parameters.OutputFolder = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\TempOutput"; var expectedPeaksFile = Path.Combine(parameters.OutputFolder, run.DatasetName + "_peaks.txt"); if (File.Exists(expectedPeaksFile)) { File.Delete(expectedPeaksFile); } var workflow = new PeakDetectAndExportWorkflow(run, parameters); workflow.Execute(); var fileinfo = new FileInfo(expectedPeaksFile); Assert.IsTrue(fileinfo.Exists); Assert.IsTrue(fileinfo.Length > 1000000); }
public static Run CreateAndAlignRun(string fileOrDirectoryPath, string peaksFile) { var directoryExists = Directory.Exists(fileOrDirectoryPath); var fileExists = File.Exists(fileOrDirectoryPath); Check.Require(directoryExists || fileExists, "Dataset file (or directory) not found error when RunUtilities tried to create Run."); var rf = new RunFactory(); var run = rf.CreateRun(fileOrDirectoryPath); Check.Ensure(run != null, "RunUtilities could not create run. Run is null."); //Console.WriteLine(run.DatasetName + " loaded."); AlignRunUsingAlignmentInfoInFiles(run); string sourcePeaksFile; if (string.IsNullOrEmpty(peaksFile)) { // ReSharper disable once PossibleNullReferenceException (already checked for null above) sourcePeaksFile = Path.Combine(run.DatasetDirectoryPath, run.DatasetName + "_peaks.txt"); } else { sourcePeaksFile = peaksFile; } GetPeaks(run, sourcePeaksFile); // Console.WriteLine("Peaks loaded = " + run.ResultCollection.MSPeakResultList.Count); return(run); }
public void doAlignmentTest1() { var rf = new RunFactory(); var run = rf.CreateRun(DeconTools.UnitTesting2.FileRefs.RawDataMSFiles.OrbitrapStdFile1); var deconToolsResultFile = Path.Combine(FileRefs.ImportedData, "QC_Shew_08_04-pt5-2_11Jan09_Sphinx_08-11-18_targetedFeatures.txt"); var importer = new UnlabelledTargetedResultFromTextImporter(deconToolsResultFile); var repo = importer.Import(); var massTagFile = @"\\protoapps\UserData\Slysz\Data\MassTags\qcshew_standard_file_allMassTags.txt"; var mtc = new TargetCollection(); var mtimporter = new MassTagFromTextFileImporter(massTagFile); mtc = mtimporter.Import(); var aligner = new NETAndMassAligner(); aligner.SetFeaturesToBeAligned(repo.Results); aligner.SetReferenceMassTags(mtc.TargetList); aligner.Execute(run); float testScan = 6005; var testNET1 = run.NetAlignmentInfo.GetNETValueForScan((int)testScan); //note - this is Multialign's Assert.AreEqual(0.3253423m, (decimal)testNET1); }
public void UnknownDatasetTypeTest1() { var testfile = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\Other_testFileTypes\sampleXYData.wiffer"; var rf = new RunFactory(); var run = rf.CreateRun(testfile); }
public void createBruker_fromBruker9T_Test1() { var rf = new RunFactory(); var run = rf.CreateRun(FileRefs.RawDataMSFiles.Bruker9TStandardFile1); Assert.AreEqual(Globals.MSFileType.Bruker, run.MSFileType); Assert.AreEqual(599, run.MaxLCScan); }
public void createBrukerSolarixRunTest1() { var rf = new RunFactory(); var run = rf.CreateRun(FileRefs.RawDataMSFiles.BrukerSolarix12TFile1); Assert.AreEqual(Globals.MSFileType.Bruker, run.MSFileType); Assert.AreEqual(7, run.MaxLCScan); }
public void createBruker_fromBruker12T_FID_Test1() { var rf = new RunFactory(); var run = rf.CreateRun(FileRefs.RawDataMSFiles.BrukerSolarix12T_FID_File1); Assert.IsNotNull(run); Assert.AreEqual(Globals.MSFileType.Bruker, run.MSFileType); Assert.AreEqual(0, run.MaxLCScan); }
public void Test1() { var rf = new RunFactory(); var run = rf.CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var ssf = new ScanSetFactory(); var scan = ssf.CreateScanSet(run, 6005, 11); Console.WriteLine(scan); }
public void oldSchoolTest1() { string testFile = @"D:\Data\UIMF\Problem_datasets\FPGA\QCSHEW_FPGA_99min_0003.UIMF"; string paramFile = @"D:\Data\UIMF\Problem_datasets\FPGA\IMS_UIMF_PeakBR4_PeptideBR4_SN3_SumScansAll_SumFrames3_RAPID_2011-02-09_temp.xml"; RunFactory rf = new RunFactory(); UIMFRun run = (UIMFRun)rf.CreateRun(testFile); //OldSchoolProcRunner proc = new OldSchoolProcRunner(testFile, run.MSFileType, paramFile); //proc.Execute(); }
public void CreateMZ5RunTest1() { var testfile = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\mzXML\QC_Shew_08_04-pt5-2_11Jan09_Sphinx_08-11-18.mz5"; var rf = new RunFactory(); var run = rf.CreateRun(testfile); Assert.AreEqual(Globals.MSFileType.MZ5, run.MSFileType); Assert.AreEqual(18504, run.MaxLCScan); }
public void CreateSingleScansetThatSumsAll() { var rf = new RunFactory(); var run = rf.CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1); run.ScanSetCollection.Create(run, true, true); Console.WriteLine(run.ScanSetCollection.ScanSetList[0]); Assert.AreEqual(2695, run.ScanSetCollection.ScanSetList[0].IndexValues.Count); }
public void CreateBrukerTOFRunTest1() { var testfile = @"\\protoapps\UserData\Slysz\DeconTools_TestFiles\Bruker\Bruker_Maxis\2012_05_15_MN9_A_000001.d"; var rf = new RunFactory(); var run = rf.CreateRun(testfile); Assert.AreEqual(Globals.MSFileType.Bruker, run.MSFileType); Assert.IsTrue(run is BrukerTOF); Assert.AreEqual(1131, run.GetNumMSScans()); }
public void CreateScanSetBasedOnRangeOfScansTest1() { var startScan = 5970; var stopScan = 6035; var rf = new RunFactory(); var run = rf.CreateRun(FileRefs.RawDataMSFiles.OrbitrapStdFile1); var ssf = new ScanSetFactory(); var scan = ssf.CreateScanSet(run, 6005, startScan, stopScan); Assert.AreEqual("6005 {5970, 5977, 5984, 5991, 5998, 6005, 6012, 6019, 6026, 6033}", scan.ToString()); }
private void InitializeRun(string datasetName) { //Datasets have to all be in the same folder //currently works for datasets that have a File reference as //opposed to datasets having a Folder reference (Agilent/Bruker) DirectoryInfo dirInfo = new DirectoryInfo(_fileInputs.DatasetDirectory); var fileInfo = dirInfo.GetFiles(datasetName + ".*"); if (!fileInfo.Any()) { throw new FileNotFoundException("Run could not be initialized. File not found"); } RunFactory rf = new RunFactory(); Run = rf.CreateRun(fileInfo.First().FullName); bool peaksFileExists = checkForPeaksFile(); if (!peaksFileExists) { ReportGeneralProgress("Creating extracted ion chromatogram (XIC) source data... takes 1-5 minutes.. only needs to be done once."); CreatePeaksForChromSourceData(); ReportGeneralProgress("Done creating XIC source data."); } string baseFileName; baseFileName = this.Run.DataSetPath + "\\" + this.Run.DatasetName; string expectedPeaksFilename = baseFileName + "_peaks.txt"; if (File.Exists(expectedPeaksFilename)) { PeakImporterFromText peakImporter = new PeakImporterFromText(expectedPeaksFilename, _backgroundWorker); peakImporter.ImportPeaks(this.Run.ResultCollection.MSPeakResultList); } else { ReportGeneralProgress(DateTime.Now + "\tCRITICAL FAILURE. Chrom source data (_peaks.txt) file not loaded."); return; } ReportGeneralProgress(DateTime.Now + "\tPeak Loading complete."); return; }