Exemplo n.º 1
0
 private static void MyEngine_startingSingleEngineHander(object sender, SingleEngineEventArgs e)
 {
     if (InProgress)
     {
         MyWriter.WriteLine();
     }
     InProgress = false;
     WriteMultiLineIndented("Starting engine: " + e.MyEngine.GetType().Name + " " + e.MyEngine.GetId());
     MyWriter.Indent++;
 }
Exemplo n.º 2
0
        public static void SingleEventArgsTest()
        {
            Protein          parentProteinForMatch = new Protein("MEK", null);
            CommonParameters commonParameters      = new CommonParameters(digestionParams: new DigestionParams(minPeptideLength: 1));
            var fsp = new List <(string fileName, CommonParameters fileSpecificParameters)>();

            fsp.Add(("", commonParameters));
            ModificationMotif.TryGetMotif("E", out ModificationMotif motif);
            List <Modification> variableModifications = new List <Modification> {
                new Modification(_originalId: "21", _target: motif, _locationRestriction: "Anywhere.", _monoisotopicMass: 21.981943)
            };

            List <PeptideWithSetModifications> allPeptidesWithSetModifications = parentProteinForMatch.Digest(commonParameters.DigestionParams, new List <Modification>(), variableModifications).ToList();

            Assert.AreEqual(4, allPeptidesWithSetModifications.Count());
            PeptideWithSetModifications ps = allPeptidesWithSetModifications.First();

            PeptideWithSetModifications pepWithSetModsForSpectrum = allPeptidesWithSetModifications[1];
            MsDataFile myMsDataFile = new TestDataFile(new List <PeptideWithSetModifications> {
                pepWithSetModsForSpectrum
            });
            Tolerance fragmentTolerance = new AbsoluteTolerance(0.01);

            Ms2ScanWithSpecificMass scan = new Ms2ScanWithSpecificMass(myMsDataFile.GetAllScansList().Last(), pepWithSetModsForSpectrum.MonoisotopicMass.ToMz(1), 1, null, new CommonParameters());

            var theoreticalProducts = new List <Product>();

            ps.Fragment(DissociationType.HCD, FragmentationTerminus.Both, theoreticalProducts);

            var matchedIons             = MetaMorpheusEngine.MatchFragmentIons(scan, theoreticalProducts, new CommonParameters());
            PeptideSpectralMatch newPsm = new PeptideSpectralMatch(ps, 0, 0, 2, scan, commonParameters, matchedIons);

            LocalizationEngine f = new LocalizationEngine(new List <PeptideSpectralMatch> {
                newPsm
            }, myMsDataFile, new CommonParameters(), fsp, new List <string>());

            var singleEngine = new SingleEngineEventArgs(f);

            Assert.That(singleEngine.MyEngine.Equals(f));

            var singleFile = new SingleFileEventArgs("", new List <string>());

            Assert.That(singleFile.WrittenFile.Equals(""));

            var stringList = new StringListEventArgs(new List <string>());
            var rr         = (stringList.StringList.DefaultIfEmpty().First());

            Assert.That(stringList.StringList.DefaultIfEmpty().First() == null);
        }
Exemplo n.º 3
0
        private static void MyEngine_startingSingleEngineHander(object sender, SingleEngineEventArgs e)
        {
            if (InProgress)
            {
                if (CommandLineSettings.Verbosity == CommandLineSettings.VerbosityType.normal)
                {
                    MyWriter.WriteLine();
                }
            }

            InProgress = false;

            if (CommandLineSettings.Verbosity == CommandLineSettings.VerbosityType.normal)
            {
                WriteMultiLineIndented("Starting engine: " + e.MyEngine.GetType().Name + " " + e.MyEngine.GetId());
                MyWriter.Indent++;
            }
        }