original_docstring: Parse a PDB file and return a Structure object.
docstring: Parse a PDB file and return a Structure object.
docstring_tokens: Parse a PDB file and return a Structure object .
code: def PDBParser(open_file, structure_id=None, forgive=2):
      """Parse a PDB file and return a Structure object."""
      file_ = open_file.readlines()
      builder = StructureBuilder()
  
      c_offset = get_coords_offset(file_)
      t_offset = get_trailer_offset(file_)
  
      raw_coords = file_[c_offset:t_offset]
      raw_trailer = file_[t_offset:]
      raw_header = file_[:c_offset]
  
      parsed_header = parse_header(raw_header)
      parsed_trailer = parse_trailer(raw_trailer)
      structure_id = (structure_id or parsed_header.get('id'))
      builder.initStructure(structure_id)
      structure = parse_coords(builder, raw_coords, forgive)
  
      # only X-ray structures will contain crystallographic data
      if parsed_header.get('expdta') == 'X-RAY':
          symetry_info = get_symmetry(raw_header)
          parsed_header.update(symetry_info)
  
      structure.header = parsed_header
      structure.trailer = parsed_trailer
      structure.raw_header = raw_header
      structure.raw_trailer = raw_trailer
  
      return structure
code_tokens: def PDBParser ( open_file , structure_id = None , forgive = 2 ) : file_ = open_file . readlines ( ) builder = StructureBuilder ( ) c_offset = get_coords_offset ( file_ ) t_offset = get_trailer_offset ( file_ ) raw_coords = file_ [ c_offset : t_offset ] raw_trailer = file_ [ t_offset : ] raw_header = file_ [ : c_offset ] parsed_header = parse_header ( raw_header ) parsed_trailer = parse_trailer ( raw_trailer ) structure_id = ( structure_id or parsed_header . get ( 'id' ) ) builder . initStructure ( structure_id ) structure = parse_coords ( builder , raw_coords , forgive ) if parsed_header . get ( 'expdta' ) == 'X-RAY' : symetry_info = get_symmetry ( raw_header ) parsed_header . update ( symetry_info ) structure . header = parsed_header structure . trailer = parsed_trailer structure . raw_header = raw_header structure . raw_trailer = raw_trailer return structure
short_docstring: Parse a PDB file and return a Structure object.
short_docstring_tokens: Parse a PDB file and return a Structure object .
comment: """Parse a PDB file and return a Structure object."""$SEP$# only X-ray structures will contain crystallographic data