Ejemplo n.º 1
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (MainThread != null && MainThread.IsAlive)
     {
         MainThread.Abort();
     }
     if (Hoarder != null)
     {
         //Hoarder.UpdateLog -= new EventHandler<StatusEventArgs>(hoarder_UpdateLog);
         //Hoarder.UpdateProgress -= new EventHandler<ProgressEventArgs>(hoarder_UpdateProgress);
         Hoarder = null;
     }
     Properties.Settings.Default.Save();
     e.Cancel = false;
 }
Ejemplo n.º 2
0
 public void UpdateProgress(double percent)
 {
     if (InvokeRequired)
     {
         if (Hoarder != null)
         {
             Invoke(new UpdateProgressDelegate(UpdateProgress), new object[] { percent });
         }
     }
     else
     {
         // If the precent is less than zero, the program is finished
         if (percent < 0)
         {
             hoardB.Enabled    = true;
             outputGB.Enabled  = true;
             inputGB.Enabled   = true;
             optionsGB.Enabled = true;
             quantGB.Enabled   = true;
             progressBar.Style = ProgressBarStyle.Continuous;
             progressBar.Value = 0;
             WriteLog();
             Hoarder.UpdateLog      -= hoarder_UpdateLog;
             Hoarder.UpdateProgress -= hoarder_UpdateProgress;
             Hoarder = null;
         }
         else if (percent == 0.0)
         {
             progressBar.Style = ProgressBarStyle.Marquee;
             progressBar.Value = 0;
         }
         else
         {
             progressBar.Style = ProgressBarStyle.Blocks;
             progressBar.Value = (int)(10000 * percent);
         }
     }
 }
Ejemplo n.º 3
0
        public void Run()
        {
            string fastaFile = databaseTB.Text;

            if (!System.IO.File.Exists(fastaFile))
            {
                UpdateLog("Cannot find protein database " + fastaFile + ", aborting!");
                return;
            }

            string outputDirectory = outputTB.Text;

            if (string.IsNullOrWhiteSpace(outputDirectory))
            {
                UpdateLog("Must provide a valid output folder!");
                return;
            }

            if (!System.IO.Directory.Exists(outputDirectory))
            {
                UpdateLog("Output directory " + outputDirectory + " doesn't exist, creating it...");
                System.IO.Directory.CreateDirectory(outputDirectory);
            }

            int    minPeptidesperGroup = (int)minpepspergroupUD.Value;
            int    maxMissedCleavage   = (int)maxMissedCleavagedUD.Value;
            double maxFDR          = (double)fdrUD.Value;
            bool   useConservative = conservativeCB.Checked;
            bool   useQuant        = enableQuantCB.Checked;
            //bool filterinterference = quantigorneinterferenceCB.Checked;
            bool           includeUnfiltereedResults     = includeUnfliterCB.Checked;
            bool           ignorePeptidesWithMissingData = ignorePepMissingCB.Checked;
            bool           semiDigestion       = semiCB.Checked;
            bool           proteinPerMin       = proteinsPerMinCB.Checked;
            bool           duplexQuant         = duplexCB.Enabled && duplexCB.Checked;
            bool           useMedian           = medianvalueCB.Enabled && medianvalueCB.Checked;
            bool           useNoiseBandCap     = useNBCCB.Enabled && useNBCCB.Checked;
            bool           sequenceCoverageMap = sequenceMapCB.Enabled && sequenceMapCB.Checked;
            AnnotationType annotationType      = (AnnotationType)comboBox1.SelectedItem;
            //double interferencecutoff = (double)quantintferenceUD.Value;

            HashSet <Modification> modstoignore = new HashSet <Modification>();

            if (useQuant)
            {
                foreach (string modName in ignoreModsCLB.CheckedItems.Cast <string>())
                {
                    Modification mod = new Modification(modName, true);
                    // mod.IgnoreMod = true;
                    modstoignore.Add(mod);
                }
            }
            logTB.Clear();
            Hoarder                 = new ProteinHoarder(CsvFiles, fastaFile, outputDirectory, minPeptidesperGroup, maxMissedCleavage, maxFDR, annotationType, useConservative, useQuant, useMedian, duplexQuant, useNoiseBandCap, modstoignore, false, 0.0, includeUnfiltereedResults, ignorePeptidesWithMissingData, semiDigestion, proteinPerMin, sequenceCoverageMap);
            Hoarder.UpdateLog      += new EventHandler <StatusEventArgs>(hoarder_UpdateLog);
            Hoarder.UpdateProgress += new EventHandler <ProgressEventArgs>(hoarder_UpdateProgress);
            MainThread              = new Thread(Hoarder.Herd);
            MainThread.IsBackground = true;
            MainThread.Start();
            hoardB.Enabled    = false;
            outputGB.Enabled  = false;
            inputGB.Enabled   = false;
            optionsGB.Enabled = false;
            quantGB.Enabled   = false;
        }