public static DatabasePeptide Read(BinaryReader reader) { try { DatabasePeptide result = new DatabasePeptide(); result.length = reader.ReadByte(); result.monoisotopicMass = reader.ReadDouble(); int nproteins = reader.ReadInt32(); for (int i = 0; i < nproteins; i++) { result.proteinIndices.Add(reader.ReadInt32()); result.proteinOffsets.Add(reader.ReadUInt16()); } result.fixedModifications = new PeptideModificationCounts(reader); return(result); } catch (EndOfStreamException) { return(null); } }
public ModifiedPeptide(DatabasePeptide peptide, int peptideIndex, string sequence) { this.peptideIndex = peptideIndex; modifications = new PeptideModificationState(sequence.Length); mass = peptide.GetMonoIsotopicMass(sequence); }