private static void MapSequencesToSpectra(List <MSFeatureLight> features, string path) { var reader = new MsgfReader { Delimiter = '\t' }; var peptides = reader.ReadFile(path); var scanMap = new Dictionary <int, Peptide>(); foreach (var p in peptides) { if (!scanMap.ContainsKey(p.Scan)) { scanMap.Add(p.Scan, p); } } foreach (var feature in features) { foreach (var spectrum in feature.MSnSpectra) { var hasScan = scanMap.ContainsKey(spectrum.Scan); if (hasScan) { spectrum.Peptides.Add(scanMap[spectrum.Scan]); } } } }
public static ISequenceFileReader CreateReader(SequenceFileType type) { ISequenceFileReader reader = null; switch (type) { case SequenceFileType.SEQUESTFirstHit: break; case SequenceFileType.MSGF: reader = new MsgfReader(); break; case SequenceFileType.SkylineTransitionFile: reader = new SkylineTransitionFileReader(); break; } return(reader); }
private static void MapSequencesToSpectra(List<MSFeatureLight> features, string path) { var reader = new MsgfReader { Delimiter = '\t' }; var peptides = reader.ReadFile(path); var scanMap = new Dictionary<int, Peptide>(); foreach (var p in peptides) { if (!scanMap.ContainsKey(p.Scan)) { scanMap.Add(p.Scan, p); } } foreach (var feature in features) { foreach (var spectrum in feature.MSnSpectra) { var hasScan = scanMap.ContainsKey(spectrum.Scan); if (hasScan) { spectrum.Peptides.Add(scanMap[spectrum.Scan]); } } } }