public void Test1()
        {
            TargetedWorkflowParameters o16o18workflowParameters = new O16O18WorkflowParameters();
            var parentWorkflow = new O16O18IqWorkflow(o16o18workflowParameters);

            TargetedWorkflowParameters workflowParameters = new BasicTargetedWorkflowParameters();
            var childWorkflow = new BasicIqWorkflow(workflowParameters);

            IqTarget parentTarget = new IqChargeStateTarget();

            IqTarget childTarget1 = new IqChargeStateTarget();
            IqTarget childTarget2 = new IqChargeStateTarget();
            IqTarget childTarget3 = new IqChargeStateTarget();


            parentTarget.AddTarget(childTarget1);
            parentTarget.AddTarget(childTarget2);
            parentTarget.AddTarget(childTarget3);

            var workflowAssigner = new IqWorkflowAssigner();

            workflowAssigner.AssignWorkflowToParent(parentWorkflow, parentTarget);
            workflowAssigner.AssignWorkflowToChildren(childWorkflow, parentTarget);

            Assert.IsNotNull(parentTarget.ChildTargets().First().Workflow);

            var childTargets = parentTarget.ChildTargets();

            foreach (var childTarget in childTargets)
            {
                Assert.IsTrue(childTarget.Workflow is BasicIqWorkflow);
            }

            Assert.IsTrue(parentTarget.Workflow is O16O18IqWorkflow);
        }
        public void NodeLevelTest1()
        {
            var util = new IqTargetUtilities();

            IqTarget iqTarget1 = new IqChargeStateTarget();
            IqTarget iqTarget2 = new IqChargeStateTarget();

            IqTarget iqTarget3_1 = new IqChargeStateTarget();

            iqTarget3_1.ID = 3001;


            IqTarget iqTarget3_2 = new IqChargeStateTarget();

            iqTarget3_2.ID = 3002;



            IqTarget iqTarget4 = new IqChargeStateTarget();

            IqTarget iqTarget5 = new IqChargeStateTarget();



            iqTarget4.AddTarget(iqTarget5);
            iqTarget3_1.AddTarget(iqTarget4);
            iqTarget2.AddTarget(iqTarget3_1);
            iqTarget2.AddTarget(iqTarget3_2);
            iqTarget1.AddTarget(iqTarget2);


            var rootNode = iqTarget5.RootTarget;

            Assert.AreEqual(rootNode, iqTarget1);


            var nodeLevelCount = util.GetTotalNodelLevels(iqTarget1);

            Assert.AreEqual(5, nodeLevelCount);

            nodeLevelCount = util.GetTotalNodelLevels(iqTarget5);

            Assert.AreEqual(5, nodeLevelCount);

            var targetList = new List <IqTarget>();

            targetList.Add(iqTarget1);

            var level2Targets = util.GetTargetsFromNodelLevel(targetList, 2);

            foreach (var level2Target in level2Targets)
            {
                Console.WriteLine(level2Target);
            }
        }
示例#3
0
        public void ChromPeakAnalyzerWorkflowTest()
        {
            //Reference JIRA: https://jira.pnnl.gov/jira/browse/OMCS-884

            var testFile      = UnitTesting2.FileRefs.RawDataMSFiles.OrbitrapStdFile1;
            var peaksTestFile = UnitTesting2.FileRefs.PeakDataFiles.OrbitrapPeakFile_scans5500_6500;
            var run           = new RunFactory().CreateRun(testFile);
            TargetedWorkflowParameters parameters = new BasicTargetedWorkflowParameters();
            var testTarget = new ChromPeakIqTarget();
            ITheorFeatureGenerator TheorFeatureGen = new JoshTheorFeatureGenerator(DeconTools.Backend.Globals.LabellingType.NONE, 0.005);

            var testPeak = new ChromPeak(5184, 840963, 50, 0);

            var executorBaseParameters = new BasicTargetedWorkflowExecutorParameters();
            var executor = new TopDownMSAlignExecutor(executorBaseParameters, run);

            executor.ChromSourceDataFilePath = peaksTestFile;

            var workflow = new ChromPeakAnalyzerIqWorkflow(run, parameters);

            testTarget.SetWorkflow(workflow);

            testTarget.ID                   = 1;
            testTarget.Code                 = "NGIIMMENR";
            testTarget.EmpiricalFormula     = "C43H76N14O14S2";
            testTarget.MonoMassTheor        = 1076.510631;
            testTarget.ChromPeak            = testPeak;
            testTarget.ChargeState          = 1;
            testTarget.TheorIsotopicProfile = TheorFeatureGen.GenerateTheorProfile(testTarget.EmpiricalFormula, testTarget.ChargeState);

            var      testTargetList = new List <IqTarget>();
            IqTarget testParent     = new IqChargeStateTarget();

            testParent.AddTarget(testTarget);
            testTargetList.Add(testTarget);

            executor.Execute(testTargetList);

            var result = testTarget.GetResult();

            Assert.NotNull(result.LCScanSetSelected);
            Assert.AreNotEqual(1, result.FitScore);
            Assert.AreEqual(true, result.IsotopicProfileFound);
        }