예제 #1
0
        /// <summary>
        /// Static method for parsing structure entries in a pdb file and instantiating the correct
        /// <see cref="Structure" /> subclass.
        /// </summary>
        /// <param name="pdbLine">A structure entry from a pdb file.</param>
        /// <returns>An instance of a <see cref="Structure" /> subclass.</returns>
        internal static Structure CreateStructure(string pdbLine)
        {
            Structure structure = null;

            if (pdbLine.StartsWith("HELIX"))
            {
                structure = new Helix();
            }
            else if (pdbLine.StartsWith("SHEET"))
            {
                structure = new Sheet();
            }

            structure.chainIdentifier = pdbLine.Substring(structure.ChainIdentifierColumn, 1);

            structure.startResidueSequenceNumber =
                Convert.ToInt32(pdbLine.Substring(structure.StartResidueSequenceNumberColumn, 4));
            structure.endResidueSequenceNumber =
                Convert.ToInt32(pdbLine.Substring(structure.EndResidueSequenceNumberColumn, 4));

            return(structure);
        }
예제 #2
0
        /// <summary>
        /// Static method for parsing structure entries in a pdb file and instantiating the correct
        /// <see cref="Structure" /> subclass.
        /// </summary>
        /// <param name="pdbLine">A structure entry from a pdb file.</param>
        /// <returns>An instance of a <see cref="Structure" /> subclass.</returns>
        internal static Structure CreateStructure(string pdbLine)
        {
            Structure structure = null;

            if (pdbLine.StartsWith("HELIX"))
                structure = new Helix();
            else if (pdbLine.StartsWith("SHEET"))
                structure = new Sheet();

            structure.chainIdentifier = pdbLine.Substring(structure.ChainIdentifierColumn, 1);

            structure.startResidueSequenceNumber =
                Convert.ToInt32(pdbLine.Substring(structure.StartResidueSequenceNumberColumn, 4));
            structure.endResidueSequenceNumber =
                Convert.ToInt32(pdbLine.Substring(structure.EndResidueSequenceNumberColumn, 4));

            return structure;
        }