private PeakList <MatchedPeak> GetAnnotatedPeakList() { PeakList <MatchedPeak> pkl = new DtaFormat <MatchedPeak>().ReadFromFile(dtaFile.FullName); var b = (from p in pkl orderby p.Intensity descending select p).ToList().Take(10); foreach (var p in b) { p.PeakType = IonType.B; } return(pkl); }
public void TestWriteToDta() { PeakList<Peak> spectrum = new DtaFormat<Peak>().ReadFromFile(this.testDtaFile); var fi = new FileInfo(this.testDtaFile); string tmpFile = fi.DirectoryName + "\\a.1.1." + spectrum.PrecursorCharge + ".dta"; try { this.dtaFormat.WriteToFile(tmpFile, spectrum); PeakList<Peak> tmpSpectrum = this.dtaFormat.ReadFromFile(tmpFile); Assert.AreEqual(spectrum.PrecursorMZ, tmpSpectrum.PrecursorMZ, 0.001); Assert.AreEqual(spectrum.PrecursorCharge, tmpSpectrum.PrecursorCharge); Assert.AreEqual(spectrum.Count, tmpSpectrum.Count); } finally { new FileInfo(tmpFile).Delete(); } }