public override IEnumerable <SpectrumInfo> GetSpectra(LibKey key, IsotopeLabelType labelType, LibraryRedundancy redundancy) { // This base class only handles best match spectra SpectrumHeaderInfo libInfo; if (redundancy == LibraryRedundancy.best && TryGetLibInfo(key, out libInfo)) { yield return new SpectrumInfo(this, labelType, key) { SpectrumHeaderInfo = libInfo } } ; }
public override IEnumerable <SpectrumInfo> GetSpectra(LibKey key, IsotopeLabelType labelType, LibraryRedundancy redundancy) { int iEntry = FindEntry(key); if (iEntry < 0) { return(new SpectrumInfo[0]); } var entry = _libraryEntries[iEntry]; return(entry.FileDatas.Where(kvp => { if (!kvp.Value.ApexTime.HasValue) { return false; } if (redundancy == LibraryRedundancy.best && kvp.Key != entry.BestFileId) { return false; } return true; }) .Select(kvp => new SpectrumInfo(this, labelType, _sourceFiles[kvp.Key], kvp.Value.ApexTime, null, kvp.Key == entry.BestFileId, new ElibSpectrumKey(iEntry, kvp.Key)) { SpectrumHeaderInfo = CreateSpectrumHeaderInfo(entry) })); }
public override IEnumerable <SpectrumInfoLibrary> GetSpectra(LibKey key, IsotopeLabelType labelType, LibraryRedundancy redundancy) { if (redundancy == LibraryRedundancy.best) { yield break; } if (!key.IsPrecursorKey) { foreach (var spectrum in GetSpectraByPeptide(null, key)) { yield return(new SpectrumInfoLibrary(this, labelType, spectrum.ResultsFile.FilePath, spectrum.RetentionTime, null, false, spectrum)); } yield break; } var keyRt = key.RetentionTime; foreach (var spectrum in GetSpectraByPrecursor(null, key.PrecursorMz.GetValueOrDefault())) { if (!keyRt.HasValue || Equals(keyRt.Value, spectrum.RetentionTime)) { yield return(new SpectrumInfoLibrary(this, labelType, spectrum.ResultsFile.FilePath, spectrum.RetentionTime, null, false, spectrum)); } } }
public override IEnumerable<SpectrumInfo> GetSpectra(LibKey key, IsotopeLabelType labelType, LibraryRedundancy redundancy) { // This base class only handles best match spectra SpectrumHeaderInfo libInfo; if (redundancy == LibraryRedundancy.best && TryGetLibInfo(key, out libInfo)) yield return new SpectrumInfo(this, labelType, key) { SpectrumHeaderInfo = libInfo }; }