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 ChromCorrelatorTest1()
        {
            var rawFilename = @"D:\Data\O16O18\Vlad_Mouse\mhp_plat_test_1_14April13_Frodo_12-12-04.raw";
            var run         = new RunFactory().CreateRun(rawFilename);

            WorkflowExecutorBaseParameters executorBaseParameters = new BasicTargetedWorkflowExecutorParameters();
            var executor = new IqExecutor(executorBaseParameters, run);

            executor.LoadChromData(run);

            var workflowAssigner = new IqWorkflowAssigner();

            TargetedWorkflowParameters workflowParameters = new O16O18WorkflowParameters();
            IqWorkflow workflow = new O16O18IqWorkflow(run, workflowParameters);

            IqTarget iqTarget = new IqChargeStateTarget();

            iqTarget.EmpiricalFormula = "C58H100N18O20";
            iqTarget.Code             = "GAAQNIIPASTGAAK";
            iqTarget.ID          = 1093;
            iqTarget.ChargeState = 0;

            var iqTargetList = new List <IqTarget>();

            iqTargetList.Add(iqTarget);

            var utilities = new IqTargetUtilities();

            utilities.CreateChildTargets(iqTargetList);



            workflowAssigner.AssignWorkflowToParent(workflow, iqTargetList);
            workflowAssigner.AssignWorkflowToChildren(workflow, iqTargetList);

            var theorFeatureGenerator = new JoshTheorFeatureGenerator();

            foreach (var target in iqTarget.ChildTargets())
            {
                utilities.UpdateTargetMissingInfo(target);
                target.TheorIsotopicProfile = theorFeatureGenerator.GenerateTheorProfile(target.EmpiricalFormula, target.ChargeState);
            }



            foreach (var childTarget in iqTarget.ChildTargets())
            {
                var result     = childTarget.CreateResult();
                var correlator = new O16O18ChromCorrelator(7, 0.1, 20, Globals.ToleranceUnit.PPM);
                var corrData   = correlator.CorrelateData(run, result, 5700, 6500);

                var corrDataItem1 = corrData.CorrelationDataItems.First();
                Console.WriteLine("z= \t" + childTarget.ChargeState + "\tCorrelationData (slope,intercept,rsquared)= \t" + corrDataItem1);
            }
        }