/// <summary> /// Gets the type of the secondary structure which contain /// a specified residue /// </summary> /// <param name="resdiue">Residue</param> /// <returns>Secondary structure</returns> public SecondaryStructureType GetStructureType(Residue resdiue) { SecondaryStructure structure = this.FindStructure(resdiue); if (structure != null) return structure.StructureType; return SecondaryStructureType.NotDefined; }
/// <summary> /// Finds structure in this chain that contain a residue with specified sequence number /// if there is not it - returns null /// </summary> /// <param name="resdiue">Residue</param> /// <returns>Secondary structure or null</returns> public SecondaryStructure FindStructure(Residue resdiue) { int residueSequenceNumber = resdiue.SequenceNumber; foreach(SecondaryStructure structure in this.secondaryStructures) { if (residueSequenceNumber >= structure.FirstResidueSequenceNumber && residueSequenceNumber <= structure.LastResidueSequenceNumber) return structure; } return null; }