コード例 #1
0
        public MaxQuantMgfDistillerUI()
        {
            InitializeComponent();

            this.SetFileArgument("PeptideFile", new OpenFileArgument("BuildSummary Peptides", "peptides"));

            List <ITitleParser> allParsers = TitleParserUtils.GetTitleParsers();

            this.titleParsers = new RcpaComboBox <ITitleParser>(this.cbTitleFormat, "TitleFormat", allParsers.ToArray(), 0);
            AddComponent(this.titleParsers);

            this.mgfFiles = new RcpaListViewMultipleFileField(
                this.btnAddFiles,
                this.btnRemoveFiles,
                this.btnLoad,
                this.btnSave,
                this.lvMgfFiles,
                "MgfFiles",
                new OpenFileArgument("Mascot Generic Format", new string[] { "msm", "mgf" }),
                true,
                true);
            AddComponent(this.mgfFiles);

            this.singleFile = new RcpaCheckBox(cbSingleFile, "SingleFile", false);
            AddComponent(this.singleFile);

            this.singleFileName = new RcpaFileField(btnMgfFile, txtSingleFile, "SingleFilename", new SaveFileArgument("MGF", "mgf"), false);
            AddComponent(this.singleFileName);

            Text = Constants.GetSQHTitle(title, version);
        }
コード例 #2
0
        public TitleDatasetPanel()
        {
            InitializeComponent();

            parsers           = TitleParserUtils.GetTitleParsers().ToArray();
            this.titleParsers = new RcpaComboBox <ITitleParser>(this.cbTitleFormat, "TitleFormat", parsers, parsers.Length - 1);
            AddComponent(this.titleParsers);
        }
 protected override IFileProcessor GetFileProcessor()
 {
     return(new MultipleMgf2Ms2Processor(new MultipleMgf2Ms2ProcessorOptions()
     {
         InputFiles = mgfFiles.FileNames,
         TargetDir = GetOriginFile(),
         Parser = new DefaultTitleParser(TitleParserUtils.GetTitleParsers())
     }));
 }
コード例 #4
0
 public override ISpectrumParser GetParser(string name, bool extractRank2)
 {
     if (extractRank2)
     {
         return(new CometXmlRank2Parser()
         {
             TitleParser = new DefaultTitleParser(TitleParserUtils.GetTitleParsers())
         });
     }
     else
     {
         return(new CometXmlParser()
         {
             TitleParser = new DefaultTitleParser(TitleParserUtils.GetTitleParsers())
         });
     }
 }
コード例 #5
0
        public void Test()
        {
            var parser = TitleParserUtils.GetTitleParsers().Find(m => m.FormatName == "MaxQuant");
            var format = new MaxQuantAplFormat(parser);
            var pkls   = format.ReadFromFile(TestContext.CurrentContext.TestDirectory + "/../../../data/maxquant.peak.apl");

            Assert.AreEqual(562, pkls.Count);
            Assert.AreEqual("20110915_iTRAQ_4plex_GK_6ug_Exp_1", pkls[0].Experimental);
            Assert.AreEqual(10258, pkls[0].ScanTimes[0].Scan);
            Assert.AreEqual("HCD", pkls[0].ScanMode);
            Assert.AreEqual(301.68467, pkls[0].PrecursorMZ, 0.00001);
            Assert.AreEqual(2, pkls[0].PrecursorCharge);

            Assert.AreEqual(37, pkls[0].Count);
            Assert.AreEqual(110.07127, pkls[0].First().Mz, 0.00001);
            Assert.AreEqual(2116.9580, pkls[0].First().Intensity, 0.0001);
            Assert.AreEqual(590.83301, pkls[0].Last().Mz, 0.00001);
            Assert.AreEqual(248.6751, pkls[0].Last().Intensity, 0.0001);
        }
コード例 #6
0
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
            }

            if (TitleParserUtils.FindByName(TitleType) == null)
            {
                if (!string.IsNullOrEmpty(this.TitleType) && !this.TitleType.ToLower().Equals("help"))
                {
                    ParsingErrors.Add(string.Format("Unknown title type {0}.", this.TitleType));
                }
                ParsingErrors.Add("  Those titles are valid:");
                (from t in TitleParserUtils.GetTitleParsers()
                 select t.FormatName).ToList().ForEach(m => ParsingErrors.Add("    " + m));
            }

            return(ParsingErrors.Count == 0);
        }
        public virtual ITitleParser GetTitleParser()
        {
            List <ITitleParser> allParsers = TitleParserUtils.GetTitleParsers();

            foreach (ITitleParser parser in allParsers)
            {
                if (parser.FormatName.Equals(TitleParserName))
                {
                    return(parser);
                }
            }

            foreach (ITitleParser parser in allParsers)
            {
                if (parser.FormatName.Equals(DefaultTitleParser.FORMAT_NAME))
                {
                    return(parser);
                }
            }

            return(new DefaultTitleParser());
        }
        public override bool PrepareOptions()
        {
            foreach (var file in InputFiles)
            {
                if (!File.Exists(file))
                {
                    ParsingErrors.Add(string.Format("File not exists {0}.", file));
                }
            }

            if (!string.IsNullOrEmpty(OutputDirectory) && !Directory.Exists(OutputDirectory))
            {
                ParsingErrors.Add(string.Format("Directory not exists {0}.", OutputDirectory));
            }

            if (GetTitleParser() == null)
            {
                ParsingErrors.Add(string.Format("Title is not exists {0}, select one from following list:\n{1}",
                                                TitleFormat,
                                                TitleParserUtils.GetTitleParsers().ConvertAll(m => m.FormatName).Merge("\n")));
            }

            return(ParsingErrors.Count == 0);
        }
コード例 #9
0
        public MascotGenericFormatShiftPrecursorProcessorUI()
        {
            InitializeComponent();

            this.datFiles.FileArgument = new OpenFileArgument("Mascot MGF", new string[] { "mgf", "msm" });
            AddComponent(new RcpaMultipleFileComponent(this.datFiles.GetItemInfos(), "MGFFiles", "Mgf Files", false, true));

            this.titleParsers = new RcpaComboBox <ITitleParser>(cbTitleFormat, "TitleFormat", TitleParserUtils.GetTitleParsers().ToArray(), 0);
            AddComponent(this.titleParsers);

            this.targetDirectory.SetDirectoryArgument("TargetDirectory", "Target");

            this.Text = Constants.GetSQHTitle(Title, Version);
        }
コード例 #10
0
        public PNovoSAPValidatorUI()
        {
            InitializeComponent();

            this.Text = Constants.GetSQHTitle(title, version);

            pNovoFiles.FileArgument = new OpenFileArgument("pNovo Result", "txt");
            AddComponent(this.pNovoFiles);

            this.minScore = new RcpaDoubleField(txtMinScore, "MinScore", "Minmum score", 0.65, true);
            AddComponent(this.minScore);

            this.threadCount = new RcpaIntegerField(txtThreadCount, "ThreadCount", "Thread count", Environment.ProcessorCount - 1, true);
            AddComponent(this.threadCount);

            toolTip1.SetToolTip(txtThreadCount, MyConvert.Format("Suggest max value = {0}", Environment.ProcessorCount + 1));

            this.titleParsers = new RcpaComboBox <ITitleParser>(cbTitleFormat, "TitleFormat", TitleParserUtils.GetTitleParsers().ToArray(), -1);
            AddComponent(this.titleParsers);

            fastaFile.FileArgument = new OpenFileArgument("Fasta To Find Mutation", "fasta");

            databaseFile.FileArgument = new OpenFileArgument("Fasta To Merge Mutated Peptide", "fasta");

            this.acParsers = new RcpaComboBox <IAccessNumberParser>(cbAccessNumberPattern, "AccessNumberParser", AccessNumberParserFactory.GetParsers().ToArray(), -1);
            AddComponent(this.acParsers);

            this.proteases = new RcpaComboBox <string>(cbProtease, "Protease", ProteaseManager.GetNames().ToArray(), -1);
            AddComponent(this.proteases);

            this.minLength = new RcpaIntegerField(txtMinLength, "MinLength", "Minimum Peptide Length", 6, true);
            AddComponent(this.minLength);
        }
コード例 #11
0
        public MascotDatToPepXmlConverterUI()
        {
            InitializeComponent();

            this.minPeptideLength.DefaultValue = MascotDatToPepXmlConverterOptions.DEFAULT_MinPeptideLength.ToString();
            this.targetDir.SetDirectoryArgument("TargetDir", "Target PepXML");
            this.datFiles.FileArgument = new OpenFileArgument("Mascot Dat", "dat");
            AddComponent(new RcpaMultipleFileComponent(this.datFiles.GetItemInfos(), "DatFiles", "Dat Files", false, true));

            this.titleParsers = new RcpaComboBox <ITitleParser>(cbTitleFormat, "TitleFormat", TitleParserUtils.GetTitleParsers().ToArray(), 0);
            AddComponent(this.titleParsers);

            this.Text = Constants.GetSQHTitle(title, version);
        }
        public UpdateMascotDatTitleFormatProcessorUI()
        {
            InitializeComponent();

            this.SetDirectoryArgument("TargetDir", "Target DAT");

            this.datFiles.FileArgument = new OpenFileArgument("Mascot Dat", "dat");
            AddComponent(new RcpaMultipleFileComponent(this.datFiles.GetItemInfos(), "DatFiles", "Dat Files", false, true));

            this.titleParsers = new RcpaComboBox <ITitleParser>(cbTitleFormat, "TitleFormat", TitleParserUtils.GetTitleParsers().ToArray(), 0);
            AddComponent(this.titleParsers);

            this.Text = Constants.GetSQHTitle(title, version);
        }
        public override bool PrepareOptions()
        {
            foreach (var file in InputFiles)
            {
                if (!File.Exists(file))
                {
                    ParsingErrors.Add(string.Format("File not exists {0}.", file));
                }
            }

            if (!string.IsNullOrEmpty(OutputDirectory) && !Directory.Exists(OutputDirectory))
            {
                ParsingErrors.Add(string.Format("Directory not exists {0}.", OutputDirectory));
            }

            if (GetTitleParser() == null)
            {
                ParsingErrors.Add(string.Format("Title is not exists {0}.", TitleFormat));
                Console.WriteLine("Valid title format names : \n" + StringUtils.Merge(TitleParserUtils.GetTitleParsers().ConvertAll(m => m.FormatName), "\n") + "\n");
            }

            return(ParsingErrors.Count == 0);
        }
コード例 #14
0
        public ReplaceMascotGenericFormatProcessorUI()
        {
            InitializeComponent();

            base.SetFileArgument("TargetFile", new SaveFileArgument("Target MGF", "mgf"));

            fileHeader.FileArgument = new OpenFileArgument("Precursor Info MGF", "mgf");
            this.titleHeaderParser  = new RcpaComboBox <ITitleParser>(cbHeaderFormat, "HeaderTitleFormat", TitleParserUtils.GetTitleParsers().ToArray(), 0);
            AddComponent(this.titleHeaderParser);

            filePeak.FileArgument = new  OpenFileArgument("Peak Info MGF", "mgf");
            this.titlePeakParser  = new RcpaComboBox <ITitleParser>(cbPeakFormat, "PeakTitleFormat", TitleParserUtils.GetTitleParsers().ToArray(), 0);
            AddComponent(this.titlePeakParser);

            this.titleFormat = new RcpaComboBox <ITitleFormat>(cbTitleFormat, "TitleFormat", MascotTitleFactory.Titles, 0);
            AddComponent(this.titleFormat);

            this.Text    = Constants.GetSQHTitle(title, version);
            lblInfo.Text = info;
        }
        public UpdatePepXmlModificationProcessorUI()
        {
            InitializeComponent();

            this.SetDirectoryArgument("TargetDir", "Target DAT");

            this.datFiles.FileArgument = new OpenFileArgument("PepXml", new string[] { "pepXml", "pep.xml" });
            AddComponent(new RcpaMultipleFileComponent(this.datFiles.GetItemInfos(), "PepXml", "PepXml Files", false, true));

            this.titleParsers = new RcpaComboBox <ITitleParser>(cbTitleFormat, "TitleFormat", TitleParserUtils.GetTitleParsers().ToArray(), 0);
            AddComponent(this.titleParsers);

            this.Text = Constants.GetSQHTitle(title, version);
        }