Example #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //Error check
            if (tbPepXMLFile.Text.Equals(string.Empty) || tbDBfile.Text.Equals(string.Empty) ||
                tbDecoyPrefix.Text.Equals(string.Empty) || tbMaxFDR.Text.Equals(string.Empty) ||
                cmbScoreWeights.Text.Equals(string.Empty))
            {
                MessageBox.Show("Please specify all required parameters");
                return;
            }
            double fdr = Convert.ToDouble(tbMaxFDR.Text);

            if (fdr <= 0 || fdr >= 1)
            {
                MessageBox.Show("Please input proper FDR between 0 and 1");
                return;
            }

            idpCfg                       = new IDPickerInfo();
            idpCfg.PepXMLFile            = tbPepXMLFile.Text;
            idpCfg.DBFile                = tbDBfile.Text;
            idpCfg.DecoyPrefix           = tbDecoyPrefix.Text;
            idpCfg.MaxFDR                = fdr;
            idpCfg.ScoreWeights          = cmbScoreWeights.Text;
            idpCfg.NormalizeSearchScores = (cbNormSearchScores.Checked) ? 1 : 0;
            idpCfg.OptimizeScoreWeights  = (cbOptimizeScoreWeights.Checked) ? 1 : 0;

            DialogResult = DialogResult.OK;
            Close();
        }
Example #2
0
        /// <summary>
        /// run idpQonvert to create idpXML file to determine identified spectra
        /// </summary>
        /// <param name="idpCfg"></param>
        /// <param name="outDir"></param>
        private void runIdpQonvert(IDPickerInfo idpCfg, string outDir)
        {
            // run idpQonvert and create idpXML file
            string EXE            = @"idpQonvert.exe";
            string BIN_DIR        = Path.GetDirectoryName(Application.ExecutablePath);
            string pathAndExeFile = BIN_DIR + "\\" + EXE;
            // string outputFilename = Path.GetFileNameWithoutExtension(idpCfg.PepXMLFile) + ".idpXML";
            //// IDPicker 2 args
            //string args =
            //      " -MaxFDR " + idpCfg.MaxFDR
            //    + " -NormalizeSearchScores " + idpCfg.NormalizeSearchScores
            //    + " -OptimizeScoreWeights " + idpCfg.OptimizeScoreWeights
            //    + " -SearchScoreWeights " + "\"" + idpCfg.ScoreInfo + "\""
            //    + " -DecoyPrefix " + "\"" + idpCfg.DecoyPrefix + "\""
            //    + " -WriteQonversionDetails  0 "
            //    + " -ProteinDatabase " + "\"" + idpCfg.DBFile + "\"" + " "
            //    + idpCfg.PepXMLFiles; // each file enclosed by "..." and separated by a space
            //// IDPicker 3 args
            // MaxImportFDR equal to MaxFDR to reduce idpDB size
            string args =
                " -MaxImportFDR " + idpCfg.MaxFDR
                + " -MaxFDR " + idpCfg.MaxFDR
                + " -QonverterMethod " + "\"" + idpCfg.QonverterMethod + "\""
                + " -ScoreInfo " + "\"" + idpCfg.ScoreInfo + "\""
                + " -DecoyPrefix " + "\"" + idpCfg.DecoyPrefix + "\""
                + " -WriteQonversionDetails  0 "
                + " -ProteinDatabase " + "\"" + idpCfg.DBFile + "\"" + " "
                + idpCfg.PepXMLFiles; // each file enclosed by "..." and separated by a space

            // Workspace.SetText("\r\nidpQonvert cmd\r\n" + pathAndExeFile + " " + args + "\r\n\r\n");
            try
            {
                //if (File.Exists(outputFilename))
                //{
                //    File.Delete(outputFilename);
                //}
                Workspace.SetText("\r\nidpQonvert command:\r\n" + pathAndExeFile + args + "\r\n");
                Workspace.RunProcess(pathAndExeFile, args, outDir);
            }
            catch (Exception exc)
            {
                //throw new Exception("Error running idpQonvert\r\n", exc);
                Workspace.SetText("\r\nError in running idpQonvert\r\n");
                Workspace.ChangeButtonTo("Close");
                throw new Exception(exc.Message);
            }

            //if (!File.Exists(outputFilename))
            //{
            //    throw new Exception("Error in running idpQonvert, no idpXML file generated");
            //}
        }
Example #3
0
 public RunDirecTagAction()
 {
     addLabel    = false;
     idpickerCfg = null;
     outputFilenameSuffixForRecovery = string.Empty;
 }
Example #4
0
 /// <summary>
 /// get IDPicker cfg from MainForm
 /// </summary>
 /// <returns></returns>
 private IDPickerInfo getIdpickerCfg()
 {
     IDPickerInfo idpickerCfg = new IDPickerInfo();
     idpickerCfg.PepXMLFileDir = tbPepXMLDir.Text;
     idpickerCfg.DBFile = tbDBFile.Text;
     idpickerCfg.MaxFDR = Convert.ToDouble(tbMaxFDR.Text) / 100;
     idpickerCfg.DecoyPrefix = tbDecoyPrefix.Text;
     idpickerCfg.ScoreInfo = cmbScoreInfo.Text;
     idpickerCfg.QonverterMethod = cmbQonverterMethod.Text;
     //idpickerCfg.NormalizeSearchScores = (cbNormSearchScores.Checked) ? 1 : 0;
     //idpickerCfg.OptimizeScoreWeights = (cbOptimizeScoreWeights.Checked) ? 1 : 0;
     //idpickerCfg.PepXMLFile given when running idpqonvert
     return idpickerCfg;
 }
Example #5
0
 public RunDirecTagAction()
 {
     addLabel = false;
     idpickerCfg = null;
     outputFilenameSuffixForRecovery = string.Empty;
 }
Example #6
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //Error check
            if (tbPepXMLFile.Text.Equals(string.Empty) || tbDBfile.Text.Equals(string.Empty)
                || tbDecoyPrefix.Text.Equals(string.Empty) || tbMaxFDR.Text.Equals(string.Empty)
                || cmbScoreWeights.Text.Equals(string.Empty))
            {
                MessageBox.Show("Please specify all required parameters");
                return;
            }
            double fdr = Convert.ToDouble(tbMaxFDR.Text);
            if (fdr <= 0 || fdr >= 1)
            {
                MessageBox.Show("Please input proper FDR between 0 and 1");
                return;
            }

            idpCfg = new IDPickerInfo();
            idpCfg.PepXMLFile = tbPepXMLFile.Text;
            idpCfg.DBFile = tbDBfile.Text;
            idpCfg.DecoyPrefix = tbDecoyPrefix.Text;
            idpCfg.MaxFDR = fdr;
            idpCfg.ScoreWeights = cmbScoreWeights.Text;
            idpCfg.NormalizeSearchScores = (cbNormSearchScores.Checked) ? 1 : 0;
            idpCfg.OptimizeScoreWeights = (cbOptimizeScoreWeights.Checked) ? 1 : 0;

            DialogResult = DialogResult.OK;
            Close();
        }