private static void Main(string[] args)
        {
            Console.WriteLine("Welcome to TransferModifications!");
            var p = new FluentCommandLineParser <ApplicationArguments>();

            p.Setup(arg => arg.UniProtXml)
            .As('x', "uniprot_xml")
            .Required()
            .WithDescription("UniProt protein XML file.");

            p.Setup(arg => arg.SpritzXml)
            .As('y', "spritz_xml")
            .WithDescription("Custom protein XML file, e.g. from Spritz.");

            p.Setup(arg => arg.FusionCodingEffects)
            .As('f', "fusion_coding_effect")
            .WithDescription("Coding effects from STAR-Fusion, comma separated");

            p.SetupHelp("h", "help")
            .Callback(text => Console.WriteLine(text));

            var result = p.Parse(args);

            TransferModifications(p.Object.UniProtXml, p.Object.SpritzXml ?? ProteinAnnotation.ParseCodingEffectsToXml(p.Object.FusionCodingEffects));
            DatabaseSummary(p.Object.UniProtXml, p.Object.SpritzXml);
        }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Welcome to TransferModifications!");
            var p = new FluentCommandLineParser <ApplicationArguments>();

            p.Setup(arg => arg.UniProtXml)
            .As('x', "uniprot_xml")
            .WithDescription("UniProt protein XML file.");

            p.Setup(arg => arg.SpritzXml)
            .As('y', "spritz_xml")
            .WithDescription("Custom protein XML file, e.g. from Spritz.");

            p.Setup(arg => arg.FusionCodingEffects)
            .As('f', "fusion_coding_effect")
            .WithDescription("Coding effects from STAR-Fusion, comma separated");

            p.Setup(arg => arg.SpritzModXml)
            .As('z', "spritz_mod_xml")
            .WithDescription("Custom protein XML withmods file, e.g. from Spritz.");

            p.Setup(arg => arg.Setup)
            .As('s', "setup")
            .WithDescription("Perform setup for machines without internet connection.");

            p.SetupHelp("h", "help")
            .Callback(text => Console.WriteLine(text));

            var result = p.Parse(args);

            if (p.Object.Setup)
            {
                Console.WriteLine("Downloading files for TransferUniProtModifications.");
                var uniprotPtms = ProteinAnnotation.GetUniProtMods(Environment.CurrentDirectory);
                return;
            }

            Console.WriteLine($"Analyzing UniProt database {p.Object.UniProtXml} and {p.Object.SpritzXml ?? p.Object.SpritzModXml ?? p.Object.FusionCodingEffects}");

            if (p.Object.SpritzModXml == null)
            {
                TransferModifications(p.Object.UniProtXml, p.Object.SpritzXml ?? ProteinAnnotation.ParseCodingEffectsToXml(p.Object.FusionCodingEffects));
            }
            DatabaseSummary(p.Object.UniProtXml, Path.Combine(Path.GetDirectoryName(p.Object.SpritzXml), Path.GetFileNameWithoutExtension(p.Object.SpritzXml) + ".withmods.xml"),
                            Path.Combine(Path.GetDirectoryName(p.Object.SpritzXml), Path.GetFileNameWithoutExtension(p.Object.SpritzXml) + ".accname.tsv"),
                            Path.Combine(Path.GetDirectoryName(p.Object.SpritzXml), Path.GetFileNameWithoutExtension(p.Object.SpritzXml) + ".vardesc.tsv"), true);
            DatabaseSummary(p.Object.UniProtXml, Path.Combine(Path.GetDirectoryName(p.Object.SpritzXml), Path.GetFileNameWithoutExtension(p.Object.SpritzXml) + ".withmods.xml"),
                            Path.Combine(Path.GetDirectoryName(p.Object.SpritzXml), Path.GetFileNameWithoutExtension(p.Object.SpritzXml) + ".accname.decoy.tsv"),
                            Path.Combine(Path.GetDirectoryName(p.Object.SpritzXml), Path.GetFileNameWithoutExtension(p.Object.SpritzXml) + ".vardesc.decoy.tsv"), false);
        }