예제 #1
0
        public void LoadPreviousIqResults(string filename)
        {
            IqResultImporter importer = new IqResultImporterBasic(filename);

            IqResultsForAlignment = importer.Import();

            IqLogger.Log.Info("IqMassAndNetAligner - Imported " + IqResultsForAlignment.Count + " IqResults for use in alignment. ");
        }
예제 #2
0
        public void IqExecutor_StandardO16O18Testing_VladAlz()
        {
            //see JIRA https://jira.pnnl.gov/jira/browse/OMCS-628

            var executorParametersFile =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\O16O18_standard_testing\Test1_VladAlz\Parameters\ExecutorParameters1.xml";

            var executorParameters = new BasicTargetedWorkflowExecutorParameters();

            executorParameters.LoadParameters(executorParametersFile);

            executorParameters.OutputFolderBase =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\O16O18_standard_testing\Test1_VladAlz";

            var testDatasetPath =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\O16O18_standard_testing\Test1_VladAlz\RawData\Alz_P01_A01_097_26Apr12_Roc_12-03-15.RAW";

            executorParameters.IsMassAlignmentPerformed = true;
            executorParameters.IsNetAlignmentPerformed  = true;

            executorParameters.ReferenceTargetsFilePath =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\O16O18_standard_testing\Test1_VladAlz\Targets\MT_Human_ALZ_O18_P836\MassTags_PMT2.txt";


            var expectedResultsFilename = Path.Combine(executorParameters.OutputFolderBase, "IqResults", RunUtilities.GetDatasetName(testDatasetPath) + "_iqResults.txt");

            if (File.Exists(expectedResultsFilename))
            {
                File.Delete(expectedResultsFilename);
            }



            var autoSavedExecutorParametersFile =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\O16O18_standard_testing\Test1_VladAlz\Parameters\ExecutorParameters1_autosaved.xml";

            executorParameters.SaveParametersToXML(autoSavedExecutorParametersFile);

            var run      = new RunFactory().CreateRun(testDatasetPath);
            var executor = new IqExecutor(executorParameters, run);

            var targetsFile =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\O16O18_standard_testing\Test1_VladAlz\Targets\MT_Human_ALZ_O18_P836\MassTags_PMT2_First60.txt";

            targetsFile = @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\O16O18_standard_testing\Test1_VladAlz\Targets\MT_Human_ALZ_O18_P836\MassTags_PMT2.txt";


            executor.LoadAndInitializeTargets(targetsFile);
            executor.SetupMassAndNetAlignment();

            var testTarget = 9282;

            executor.Targets = (from n in executor.Targets where n.ID == testTarget select n).ToList();

            var targetedWorkflowParameters = new BasicTargetedWorkflowParameters();

            targetedWorkflowParameters.ChromNETTolerance  = 0.025;
            targetedWorkflowParameters.ChromGeneratorMode = Globals.ChromatogramGeneratorMode.O16O18_THREE_MONOPEAKS;

            //define workflows for parentTarget and childTargets
            var parentWorkflow = new O16O18ParentIqWorkflow(run, targetedWorkflowParameters);
            var childWorkflow  = new O16O18IqWorkflow(run, targetedWorkflowParameters);

            var workflowAssigner = new IqWorkflowAssigner();

            workflowAssigner.AssignWorkflowToParent(parentWorkflow, executor.Targets);
            workflowAssigner.AssignWorkflowToChildren(childWorkflow, executor.Targets);

            executor.DoAlignment();
            executor.Execute();

            IqResultImporter importer = new IqResultImporterBasic(expectedResultsFilename);
            var allResults            = importer.Import();

            var result1 = allResults.First(p => p.Target.ID == 9282 && p.Target.ChargeState == 2);

            Assert.AreEqual(9282, result1.Target.ID);
            Assert.AreEqual(0.32678m, (decimal)result1.ElutionTimeObs);
            Assert.AreEqual(4545, result1.LcScanObs);
            Assert.AreEqual(0.02, (decimal)result1.FitScore);
        }