Exemple #1
0
        private static void Main(string[] args)
        {
            var handle = Process.GetCurrentProcess().MainWindowHandle;

            SetConsoleMode(handle, EnableExtendedFlags);

            if (args.Length % 2 != 0)
            {
                PrintUsageInfo("The number of arguments must be even.");
                return;
            }

            // initialize parameters
            var paramDic = new Dictionary <string, string>
            {
                { "-s", null },
                { "-d", null },
                { "-o", null },
                { "-e", "1" },
                { "-ntt", "2" },
                { "-mod", null },
                { "-t", "10" },
                { "-f", "10" },
                { "-tda", "0" },
                { "-minLength", "6" },
                { "-maxLength", "40" },
                { "-minCharge", "1" },
                { "-maxCharge", "4" },
                { "-minFragCharge", "1" },
                { "-maxFragCharge", "3" }
            };

            for (var i = 0; i < args.Length / 2; i++)
            {
                var key   = args[2 * i];
                var value = args[2 * i + 1];
                if (!paramDic.ContainsKey(key))
                {
                    PrintUsageInfo("Invalid parameter: " + key);
                    return;
                }
                paramDic[key] = value;
            }

            var parameters = new BottomUpInputParameters();
            var message    = parameters.Parse(paramDic);

            if (message != null)
            {
                PrintUsageInfo(message);
                return;
            }

            Console.WriteLine(Name + " " + Version);
            parameters.Display();
            parameters.Write();

            foreach (string specFilePath in parameters.SpecFilePaths)
            {
                var bottomUpLauncher = new IcBottomUpLauncher(
                    specFilePath,
                    parameters.DatabaseFilePath,
                    parameters.OutputDir,
                    parameters.AminoAcidSet,
                    parameters.Enzyme,
                    parameters.MinSequenceLength,
                    parameters.MaxSequenceLength,
                    parameters.MinPrecursorIonCharge,
                    parameters.MaxPrecursorIonCharge,
                    parameters.MinProductIonCharge,
                    parameters.MaxProductIonCharge,
                    parameters.PrecursorIonTolerancePpm,
                    parameters.ProductIonTolerancePpm,
                    parameters.Tda,
                    parameters.NumTolerableTermini
                    );

                bottomUpLauncher.RunSearch(CorrThreshold);
            }
        }
Exemple #2
0
        private static void Main(string[] args)
        {
            var handle = Process.GetCurrentProcess().MainWindowHandle;
            SetConsoleMode(handle, EnableExtendedFlags);

            if (args.Length % 2 != 0)
            {
                PrintUsageInfo("The number of arguments must be even.");
                return;
            }

            // initialize parameters
            var paramDic = new Dictionary<string, string>
            {
                {"-s", null},
                {"-d", null},
                {"-o", null},
                {"-e", "1"},
                {"-ntt", "2"},
                {"-mod", null},
                {"-t", "10"},
                {"-f", "10"},
                {"-tda", "0"},
                {"-minLength", "6"},
                {"-maxLength", "40"},
                {"-minCharge", "1"},
                {"-maxCharge", "4"},
                {"-minFragCharge", "1"},
                {"-maxFragCharge", "3"}
            };

            for (var i = 0; i < args.Length / 2; i++)
            {
                var key = args[2 * i];
                var value = args[2 * i + 1];
                if (!paramDic.ContainsKey(key))
                {
                    PrintUsageInfo("Invalid parameter: " + key);
                    return;
                }
                paramDic[key] = value;
            }

            var parameters = new BottomUpInputParameters();
            var message = parameters.Parse(paramDic);
            if (message != null)
            {
                PrintUsageInfo(message);
                return;
            }

            Console.WriteLine(Name + " " + Version);
            parameters.Display();
            parameters.Write();

            foreach (string specFilePath in parameters.SpecFilePaths)
            {
                var bottomUpLauncher = new IcBottomUpLauncher(
                    specFilePath,
                    parameters.DatabaseFilePath,
                    parameters.OutputDir,
                    parameters.AminoAcidSet,
                    parameters.Enzyme)
                {
                    MinSequenceLength = parameters.MinSequenceLength,
                    MaxSequenceLength = parameters.MaxSequenceLength,
                    MinPrecursorIonCharge = parameters.MinPrecursorIonCharge,
                    MaxPrecursorIonCharge = parameters.MaxPrecursorIonCharge,
                    MinProductIonCharge = parameters.MinProductIonCharge,
                    MaxProductIonCharge = parameters.MaxProductIonCharge,
                    PrecursorIonTolerancePpm = parameters.PrecursorIonTolerancePpm,
                    ProductIonTolerancePpm = parameters.ProductIonTolerancePpm,
                    //RunTargetDecoyAnalysisBool = parameters.TdaBool,
                    RunTargetDecoyAnalysis = parameters.Tda,
                    NumTolerableTermini = parameters.NumTolerableTermini,
                };

                bottomUpLauncher.RunSearch(CorrThreshold);
            }
        }