public void TestUpdatePrecursor() { var pkl = new PeakList <Peak>(); pkl.Precursor = new PrecursorPeak(new Peak(1000.0, 1.0, 4)); pkl.FirstScan = 620; pkl.Annotations["TITLE"] = "TCGA-AA-A01F-01A-23_W_VU_20120727_A0218_1B_R_FR04.620.620.4.dta"; var titleFormat = TitleParserUtils.FindByName("DTA"); MascotGenericFormatShiftPrecursorProcessor.UpdatePrecursor(titleFormat, pkl, -10.0, 10000); Assert.AreEqual(10620, pkl.FirstScan); Assert.AreEqual("TCGA-AA-A01F-01A-23_W_VU_20120727_A0218_1B_R_FR04.10620.10620.4.dta", pkl.Annotations["TITLE"]); Assert.AreEqual(997.5, pkl.PrecursorMZ, 0.1); }
public void Test() { var spectra = new CometXmlRank2Parser() { TitleParser = TitleParserUtils.FindByName("DTA") }.ReadFromFile(TestContext.CurrentContext.TestDirectory + "/../../../data/comet.pep.xml"); Assert.AreEqual(2, spectra.Count); Assert.AreEqual("K.M*REGPAK.N", spectra[0].Sequence); Assert.AreEqual(3, spectra[0].Rank); Assert.AreEqual(0.743, spectra[0].Score, 0.001); Assert.AreEqual(0.035, spectra[0].DeltaScore, 0.001); Assert.AreEqual(66.0, spectra[0].SpScore, 0.01); Assert.AreEqual(13, spectra[0].SpRank); Assert.AreEqual(2.47E+01, spectra[0].ExpectValue, 0.01); Assert.AreEqual(1077, spectra[0].Query.MatchCount); Assert.AreEqual("Elite_CIDIT_Human.minus10dalton.2.2.2.dta", spectra[0].Query.FileScan.LongFileName); }
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 override IEnumerable <string> Process() { var titleParser = TitleParserUtils.FindByName(options.TitleType); Progress.SetMessage("Parsing " + options.InputFile + "..."); var outputFile = options.OutputFile + ".tmp"; new Mgf2Ms2Processor(outputFile, titleParser) { Progress = this.Progress }.Process(options.InputFile); if (File.Exists(outputFile)) { File.Move(outputFile, options.OutputFile); } return(new[] { options.OutputFile }); }
public void Test() { var spectra = new CometXmlParser() { TitleParser = TitleParserUtils.FindByName("DTA") }.ReadFromFile(TestContext.CurrentContext.TestDirectory + "/../../../data/comet.pep.xml"); Assert.AreEqual(2, spectra.Count); Assert.AreEqual("R.HFM*LEMK.S", spectra[0].Sequence); Assert.AreEqual(1, spectra[0].Rank); Assert.AreEqual(0.778, spectra[0].Score, 0.001); Assert.AreEqual(0.001, spectra[0].DeltaScore, 0.001); Assert.AreEqual(80.2, spectra[0].SpScore, 0.01); Assert.AreEqual(7, spectra[0].SpRank); Assert.AreEqual(1.91E+01, spectra[0].ExpectValue, 0.01); Assert.AreEqual("sp|Q9BV73|CP250_HUMAN", spectra[0].Proteins[0]); Assert.AreEqual(4, spectra[0].MatchedIonCount); Assert.AreEqual(10, spectra[0].TheoreticalIonCount); Assert.AreEqual(803.399995, spectra[0].TheoreticalMass, 0.000001); Assert.AreEqual(2, spectra[0].Query.FileScan.Charge); Assert.AreEqual(1077, spectra[0].Query.MatchCount); Assert.AreEqual("Elite_CIDIT_Human.minus10dalton.2.2.2.dta", spectra[0].Query.FileScan.LongFileName); }
public ITitleParser GetTitleParser() { return(TitleParserUtils.FindByName(this.TitleFormat)); }