public int CompareTo(object obj) { AASequence other = (AASequence)obj; int min = Math.Min(sequence.Length, other.sequence.Length); for (int i = 0; i < min; i++) { if (sequence[i] != other.sequence[i]) { if (sequence[i] < other.sequence[i]) { return(-1); } return(1); } } if (sequence.Length != other.sequence.Length) { if (sequence.Length < other.sequence.Length) { return(-1); } return(1); } if (len != other.len) { if (len < other.len) { return(-1); } return(1); } return(0); }
public Protein(BinaryReader reader) { sequence = AASequence.Read(reader).ToString(); sequenceData = new Sequence(sequence); accession = FileUtil.ReadString(reader); description = FileUtil.ReadString(reader); molecularWeight = reader.ReadDouble(); }
public static AASequence Read(BinaryReader reader) { try { AASequence result = new AASequence(); result.len = reader.ReadInt32(); result.sequence = new ulong[reader.ReadInt32()]; for (int i = 0; i < result.sequence.Length; i++) { result.sequence[i] = reader.ReadUInt64(); } return(result); }catch (EndOfStreamException) { return(null); } }
public static Peptide Read(BinaryReader reader) { Peptide result = new Peptide(); result.sequence = AASequence.Read(reader); if (result.sequence == null) { return(null); } result.monoIsotopicMass = reader.ReadDouble(); int nproteins = reader.ReadInt32(); for (int i = 0; i < nproteins; i++) { result.proteinIndices.Add(reader.ReadInt32()); result.proteinOffsets.Add(reader.ReadInt32()); result.residueBefore.Add(reader.ReadByte()); result.residueAfter.Add(reader.ReadByte()); } result.fixedModifications = PeptideModificationState.Read(reader); return(result); }
public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj is AASequence) { AASequence other = (AASequence)obj; if (other.len != len) { return(false); } for (int i = 0; i < sequence.Length; i++) { if (sequence[i] != other.sequence[i]) { return(false); } } return(true); } return(false); }
public Peptide(string sequence) { this.sequence = new AASequence(sequence); monoIsotopicMass = MonoIsotopicMass; fixedModifications = new PeptideModificationState(sequence.Length); }