示例#1
0
        /// <summary>
        /// Read a MSPF parameter file and populate raw file and feature file.
        /// </summary>
        /// <param name="filePath">The path to the parameter file.</param>
        private void ReadParamFile(string filePath)
        {
            if (!string.IsNullOrWhiteSpace(filePath))
            {
                var mspfParams = MsPfParameters.ReadFromFile(filePath);
                var dirPath    = Path.GetDirectoryName(filePath);

                var raw = string.Format("{0}\\{1}", dirPath, mspfParams.PuSpecFile);
                if (!string.IsNullOrWhiteSpace(mspfParams.PuSpecFile) && File.Exists(raw))
                {
                    this.RawFilePath = raw;
                }

                var feature = string.Format("{0}\\{1}", dirPath, mspfParams.FeatureFile);
                if (!string.IsNullOrWhiteSpace(mspfParams.FeatureFile) && File.Exists(feature))
                {
                    this.FeatureFilePath = feature;
                }

                var fasta = string.Format("{0}\\{1}", dirPath, mspfParams.DatabaseFile);
                if (!string.IsNullOrWhiteSpace(mspfParams.DatabaseFile) && File.Exists(fasta))
                {
                    this.FastaFilePath = fasta;
                }
            }
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SearchSettingsViewModel"/> class.
        /// Initializes from <see cref="MsPfParameters" />, MSPathFinder parameters.
        /// </summary>
        /// <param name="dialogService">Dialog service for opening dialogs from view model</param>
        /// <param name="mspfParameters">The MSPathFinder parameters.</param>
        public SearchSettingsViewModel(IMainDialogService dialogService, MsPfParameters mspfParameters) : this(dialogService)
        {
            if (mspfParameters == null)
            {
                return;
            }

            this.SearchModifications.AddRange(
                mspfParameters.Modifications.Select(
                    searchMod => new SearchModificationViewModel(this.dialogService)
            {
                SearchModification = searchMod
            }));
            this.MinSequenceLength                  = mspfParameters.MinSequenceLength;
            this.MaxSequenceLength                  = mspfParameters.MaxSequenceLength;
            this.MinSequenceMass                    = mspfParameters.MinSequenceMass;
            this.MaxSequenceMass                    = mspfParameters.MaxSequenceMass;
            this.MinPrecursorIonCharge              = mspfParameters.MinPrecursorIonCharge;
            this.MaxPrecursorIonCharge              = mspfParameters.MaxPrecursorIonCharge;
            this.MinProductIonCharge                = mspfParameters.MinProductIonCharge;
            this.MaxProductIonCharge                = mspfParameters.MaxPrecursorIonCharge;
            this.PrecursorIonToleranceValue         = mspfParameters.PrecursorTolerancePpm.GetValue();
            this.ProductIonToleranceValue           = mspfParameters.ProductIonTolerancePpm.GetValue();
            this.MaxDynamicModificationsPerSequence =
                mspfParameters.MaxDynamicModificationsPerSequence;
        }
示例#3
0
 /// <summary>
 /// Set the MSPathFinder parameters given a path to a ID file.
 /// </summary>
 /// <param name="idFilePath">The id file path.</param>
 public void SetMsPfParameters(string idFilePath)
 {
     try
     {
         this.MsPfParameters = MsPfParameters.ReadFromFile(idFilePath);
     }
     catch (FormatException)
     {
         this.dialogService.MessageBox("MsPathFinder Parameters are not properly formatted.");
     }
 }
示例#4
0
        private void TestTopDownSearch(string specFilePath, string dbFilePath, string outputDir, AminoAcidSet aaSet,
                                       int minSequenceLength, int maxSequenceLength,
                                       int minPrecursorIonCharge, int maxPrecursorIonCharge,
                                       int minProductIonCharge, int maxProductIonCharge,
                                       double minSequenceMass, double maxSequenceMass,
                                       DatabaseSearchMode tda, InternalCleavageType searchMode)
        {
            var methodName = MethodBase.GetCurrentMethod().Name;

            Utils.ShowStarting(methodName);

            // Search parameters
            const int maxNumNTermCleavages     = 1; // 30
            const int maxNumCTermCleavages     = 0;
            const int precursorIonTolerancePpm = 10;
            const int productIonTolerancePpm   = 10;

            var topDownOptions = new MsPfParameters(
                specFilePath,
                dbFilePath,
                outputDir,
                aaSet, "")
            {
                MinSequenceLength        = minSequenceLength,
                MaxSequenceLength        = maxSequenceLength,
                MaxNumNTermCleavages     = maxNumNTermCleavages,
                MaxNumCTermCleavages     = maxNumCTermCleavages,
                MinPrecursorIonCharge    = minPrecursorIonCharge,
                MaxPrecursorIonCharge    = maxPrecursorIonCharge,
                MinProductIonCharge      = minProductIonCharge,
                MaxProductIonCharge      = maxProductIonCharge,
                MinSequenceMass          = minSequenceMass,
                MaxSequenceMass          = maxSequenceMass,
                PrecursorIonTolerancePpm = precursorIonTolerancePpm,
                ProductIonTolerancePpm   = productIonTolerancePpm,
                TargetDecoySearchMode    = tda,
                InternalCleavageMode     = searchMode,
            };

            var topDownLauncher = new IcTopDownLauncher(topDownOptions);

            //topDownLauncher.ForceParallel = true;
            //topDownLauncher.MaxNumThreads = -1;

            topDownLauncher.RunSearch(0.7);
            //topDownLauncher.RunIntactProteinSearch();
        }