コード例 #1
0
        public void dbTest1()
        {
            var datasetNames = new string[]
            {
                "Yellow_C13_068_30Mar10_Griffin_10-01-28",
                "Yellow_C13_064_30Mar10_Griffin_10-03-01",
                "Yellow_C13_063_30Mar10_Griffin_10-01-13"
            };

            var utilities = new DatasetUtilities();
            var path      = utilities.GetDatasetPath(datasetNames[0]);

            Console.WriteLine(path);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: trishorts/DeconTools
        public static void Main(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                ReportSyntax();
            }

            string targetFile = GetTargetFile(args);

            if (args.Length == 2 || !String.IsNullOrEmpty(targetFile))
            {
                string parameterFile = args[1];
                string fileContainingDatasetNames = args[0];

                using (StreamReader reader = new StreamReader(fileContainingDatasetNames))
                {
                    int datasetCounter = 0;
                    while (reader.Peek() != -1)
                    {
                        datasetCounter++;
                        string datsetName = reader.ReadLine();

                        bool datasetNameContainsPath = datsetName.Contains("\\");

                        string currentDatasetPath = datsetName;

                        if (datasetNameContainsPath)
                        {
                            currentDatasetPath = datsetName;
                        }
                        else
                        {
                            var datasetutil = new DatasetUtilities();

                            currentDatasetPath = Path.Combine(datasetutil.GetDatasetPath(datsetName), datsetName + ".raw");

                            if (currentDatasetPath.ToLower().Contains("purged"))
                            {
                                string tempPathWhileArchiveIsDown = @"\\protoapps\UserData\Slysz\Data\Yellowstone\RawData";

                                currentDatasetPath = Path.Combine(tempPathWhileArchiveIsDown, datsetName + ".raw");

                                //currentDatasetPath = Path.Combine(datasetutil.GetDatasetPathArchived(datsetName), datsetName + ".raw");
                            }
                        }


                        if (!File.Exists(currentDatasetPath))
                        {
                            Console.WriteLine("Dataset not found! Dataset path = " + currentDatasetPath);
                        }


                        ProcessStartInfo processStartInfo = new ProcessStartInfo();
                        //processStartInfo.UseShellExecute = false;

                        processStartInfo.FileName = @"IQConsole.exe";

                        var argString = new StringBuilder();
                        argString.Append("\"" + currentDatasetPath + "\"");
                        argString.Append(" ");
                        argString.Append("\"" + parameterFile + "\"");
                        if (!String.IsNullOrEmpty(targetFile))
                        {
                            argString.Append(" ");
                            argString.Append(targetFile);
                        }

                        processStartInfo.Arguments = argString.ToString();

                        Console.WriteLine("Argument line= " + argString);


                        try
                        {
                            Console.WriteLine("Working on dataset " + datasetCounter + "\t" + currentDatasetPath);
                            Process p = Process.Start(processStartInfo);
                            p.WaitForExit();
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("!!!!!!!!!!!!  Dataset FAILED. See log file for details. Error:");
                            Console.WriteLine(ex.Message);
                            Console.WriteLine(ex.StackTrace);
                        }
                    }
                }
            }
            else
            {
                ReportSyntax();
            }
        }
コード例 #3
0
        static int Main(string[] args)
        {
            var options = new IqConsoleOptions();

            var datasetList = new List <string>();


            if (!CommandLine.Parser.Default.ParseArguments(args, options))
            {
                return(-1);
            }

            var inputFile = options.InputFile;



            var inputFileIsAListOfDatasets = inputFile.ToLower().EndsWith(".txt");

            if (inputFileIsAListOfDatasets)
            {
                using (var reader = new StreamReader(inputFile))
                {
                    while (reader.Peek() != -1)
                    {
                        var datsetName = reader.ReadLine();
                        datasetList.Add(datsetName);
                    }
                }
            }
            else
            {
                datasetList.Add(options.InputFile);
            }


            var numDatasets    = datasetList.Count;
            var datasetCounter = 0;

            foreach (var dataset in datasetList)
            {
                datasetCounter++;

                var datasetNameContainsPath = dataset.Contains(@"\");

                string currentDatasetPath;

                if (datasetNameContainsPath)
                {
                    currentDatasetPath = dataset;
                }
                else
                {
                    if (string.IsNullOrEmpty(options.TemporaryWorkingFolder))
                    {
                        IqLogger.Log.Fatal("Trying to grab .raw file from DMS, but no temporary working folder was declared. Use option -f. ");
                        break;
                    }


                    if (string.IsNullOrEmpty(options.OutputFolder))
                    {
                        options.OutputFolder = options.TemporaryWorkingFolder;
                    }



                    var datasetutil = new DatasetUtilities();

                    //TODO: figure out how to do this while supporting other file types
                    currentDatasetPath = Path.Combine(datasetutil.GetDatasetPath(dataset), dataset + ".raw");

                    if (currentDatasetPath.ToLower().Contains("purged"))
                    {
                        currentDatasetPath = Path.Combine(datasetutil.GetDatasetPathArchived(dataset), dataset + ".raw");
                    }
                }


                if (!File.Exists(currentDatasetPath))
                {
                    IqLogger.Log.Fatal("!!!!!!!!! Dataset not found! Dataset path = " + currentDatasetPath);
                    return(-2);
                }

                if (string.IsNullOrEmpty(options.OutputFolder))
                {
                    options.OutputFolder = RunUtilities.GetDatasetParentFolder(currentDatasetPath);
                }

                var executorParameters = GetExecutorParameters(options);

                IqLogger.Log.Info("IQ analyzing dataset " + datasetCounter + " of " + numDatasets + ". Dataset = " + dataset);


                if (options.UseOldIq)
                {
                    TargetedWorkflowExecutor executor = new BasicTargetedWorkflowExecutor(executorParameters,
                                                                                          currentDatasetPath);

                    //executor.Targets.TargetList = executor.Targets.TargetList.Take(10).ToList();
                    executor.MsgfFdrScoreCutoff = 0.1;
                    executor.Execute();
                }
                else
                {
                    var run      = new RunFactory().CreateRun(currentDatasetPath);
                    var executor = new IqExecutor(executorParameters, run);

                    executor.LoadAndInitializeTargets(executorParameters.TargetsFilePath);
                    executor.SetupMassAndNetAlignment();
                    executor.DoAlignment();


                    foreach (var iqTarget in executor.Targets)
                    {
                        TargetedWorkflowParameters workflowParameters = new O16O18WorkflowParameters();

                        if (iqTarget.ElutionTimeTheor > 0.7 || iqTarget.ElutionTimeTheor < 0.15)
                        {
                            //TODO: remove the hard-coded value
                            workflowParameters.ChromNETTolerance = 0.1;
                        }
                        else
                        {
                            //TODO: remove the hard-coded value
                            workflowParameters.ChromNETTolerance = 0.025;
                        }

                        if (run.MassAlignmentInfo != null && run.MassAlignmentInfo.StdevPpmShiftData > 0)
                        {
                            workflowParameters.ChromGenTolerance = run.MassAlignmentInfo.StdevPpmShiftData * 3;
                        }

                        //define workflows for parentTarget and childTargets
                        // Note: this is currently hard-coded to user O16O18IqWorkflow
                        var parentWorkflow = new ChromPeakDeciderIqWorkflow(run, workflowParameters);
                        var childWorkflow  = new O16O18IqWorkflow(run, workflowParameters);

                        var workflowAssigner = new IqWorkflowAssigner();
                        workflowAssigner.AssignWorkflowToParent(parentWorkflow, iqTarget);
                        workflowAssigner.AssignWorkflowToChildren(childWorkflow, iqTarget);
                    }

                    executor.Execute();

                    run.Dispose();
                }
            }

            return(0);
        }