Example #1
0
        new public static IEnumerable <string> GetUsageOptions()
        {
            IEnumerable <string> options = FusionFlags.GetUsageOptions();

            List <string> additionalOptions = new List <string>();
            List <string> symmetries        = SymmetryBuilderFactory.GetKnownSymmetryNames().Where(sym => !sym.StartsWith("C")).ToList();

            // architecture options
            additionalOptions.Add(GetFormattedOptionString("-arch <architecture>", "desired symmetry architecture, options are:"));
            additionalOptions.Add(GetFormattedOptionString("", symmetries.Aggregate((a, b) => a + ", " + b)));

            // axis1 options
            additionalOptions.Add(GetFormattedOptionString("-axis1 <axis>", "first axis name corresponding to selected architecture"));
            foreach (string symmetry in symmetries)
            {
                additionalOptions.Add(GetFormattedOptionString("", String.Format("\t{0} available in architecture {1}", GetAxesOptionsString(symmetry), symmetry)));
            }

            // axis2 options
            additionalOptions.Add(GetFormattedOptionString("-axis2 <axis>", "first axis name corresponding to selected architecture"));
            foreach (string symmetry in symmetries)
            {
                additionalOptions.Add(GetFormattedOptionString("", String.Format("\t{0} available in architecture {1}", GetAxesOptionsString(symmetry), symmetry)));
            }

            // oligomer selection
            additionalOptions.Add(GetFormattedOptionString("-regex_oligomer1 <regex>", "oligomer1 pdb search pattern"));
            additionalOptions.Add(GetFormattedOptionString("-regex_oligomer2 <regex>", "oligomer2 pdb search pattern"));

            return(options.Concat(additionalOptions));
        }
Example #2
0
        public override bool ParseArgs(string[] args)
        {
            if (args.FirstOrDefault() != InstanceBaseFlag)
            {
                return(false);
            }

            if (!base.ParseArgs(args))
            {
                return(false);
            }

            for (int i = 0; i < args.Length; i++)
            {
                if (args[i] == "-arch")
                {
                    Architecture = args[i + 1];
                    if (!SymmetryBuilderFactory.GetKnownSymmetryNames().Contains(Architecture))
                    {
                        Console.WriteLine("Unknown '-arch' value - allowed values are:");
                        Console.Write(SymmetryBuilderFactory.GetKnownSymmetryNames().Aggregate("", (a, b) => a + "\n\t" + b));
                        Console.WriteLine();
                        return(false);
                    }
                    i++;
                    continue;
                }

                if (args[i] == "-regex_oligomer1")
                {
                    OligomerRegex1 = args[i + 1];
                    i++;
                    continue;
                }

                if (args[i] == "-regex_oligomer2")
                {
                    OligomerRegex2 = args[i + 1];
                    i++;
                    continue;
                }
                if (args[i] == "-axis1")
                {
                    UnitId1 = args[i + 1];
                    i++;
                    continue;
                }
                if (args[i] == "-axis2")
                {
                    UnitId2 = args[i + 1];
                    i++;
                    continue;
                }
            }

            if (Architecture == null || !SymmetryBuilderFactory.GetKnownSymmetryNames().Contains(Architecture))
            {
                Console.WriteLine("Mandatory '-arch' flag missing or invalid - allowed values are:");
                Console.Write(SymmetryBuilderFactory.GetKnownSymmetryNames().Aggregate("", (a, b) => a + "\n\t" + b));
                Console.WriteLine();
                return(false);
            }
            if (UnitId1 == null || !SymmetryBuilderFactory.GetSymmetryUnitIds(Architecture).Contains(UnitId1))
            {
                Console.WriteLine("Mandatory '-axis1' flag is missing or invalid - allowed values are:");
                Console.Write(SymmetryBuilderFactory.GetSymmetryUnitIds(Architecture).Aggregate("", (a, b) => a + "\n\t" + b));
                return(false);
            }
            if (UnitId2 == null || !SymmetryBuilderFactory.GetSymmetryUnitIds(Architecture).Contains(UnitId2))
            {
                Console.WriteLine("Mandatory '-axis1' flag is missing or invalid - allowed values are:");
                Console.Write(SymmetryBuilderFactory.GetSymmetryUnitIds(Architecture).Aggregate("", (a, b) => a + "\n\t" + b));
                return(false);
            }
            return(true);
        }