original_docstring: Parses a valid PDB line into an atomic dictionary.
docstring: Parses a valid PDB line into an atomic dictionary.
docstring_tokens: Parses a valid PDB line into an atomic dictionary .
code: def pdb2dict(line):
      """Parses a valid PDB line into an atomic dictionary."""
      at_type = line[0:6]
      ser_num = int(line[6:11])   # numbers are ints's?
      at_name = line[12:16]       # " N B "
      at_id = at_name.strip()     # "N B"
      alt_loc = line[16:17]       # always keep \s
      res_name = line[17:20]      # non standard is 4chars long
  
      chain_id = line[21:22]
      res_id = int(line[22:26].strip())   # pdb requirement int
      res_ic = line[26:27]
  
      x = line[30:38]             # no float conversion necessery
      y = line[38:46]             # it gets loaded straight into an
      z = line[46:54]             # numpy array.
      occupancy = float(line[54:60])
      bfactor = float(line[60:66])
      seg_id = line[72:76]
      element = line[76:78]
  
      h_flag = ' '                # this is the default
      if at_type == 'HETATM':     # hetatms get the het flag (it's not used for writing)
          if res_name not in ('MSE', 'SEL'): # SeMet are not ligands
              h_flag = 'H'
              res_name = '%s_%s' % (h_flag, res_name)
  
      at_long_id = (at_id, alt_loc)
      res_long_id = (res_name, res_id, res_ic)
      coords = array((x, y, z)).astype("double")
  
      result = {
      'at_type': at_type, 'ser_num': ser_num, 'at_name': at_name,
      'at_id': at_id, 'alt_loc': alt_loc, 'res_name': res_name,
      'chain_id': chain_id, 'res_id': res_id, 'res_ic': res_ic,
      'h_flag': h_flag, 'coords': coords, 'occupancy': occupancy,
      'bfactor': bfactor, 'seg_id': seg_id, 'res_long_id': res_long_id,
      'at_long_id': at_long_id, 'element':element}
      return result
code_tokens: def pdb2dict ( line ) : at_type = line [ 0 : 6 ] ser_num = int ( line [ 6 : 11 ] ) at_name = line [ 12 : 16 ] at_id = at_name . strip ( ) alt_loc = line [ 16 : 17 ] res_name = line [ 17 : 20 ] chain_id = line [ 21 : 22 ] res_id = int ( line [ 22 : 26 ] . strip ( ) ) res_ic = line [ 26 : 27 ] x = line [ 30 : 38 ] y = line [ 38 : 46 ] z = line [ 46 : 54 ] occupancy = float ( line [ 54 : 60 ] ) bfactor = float ( line [ 60 : 66 ] ) seg_id = line [ 72 : 76 ] element = line [ 76 : 78 ] h_flag = ' ' if at_type == 'HETATM' : if res_name not in ( 'MSE' , 'SEL' ) : h_flag = 'H' res_name = '%s_%s' % ( h_flag , res_name ) at_long_id = ( at_id , alt_loc ) res_long_id = ( res_name , res_id , res_ic ) coords = array ( ( x , y , z ) ) . astype ( "double" ) result = { 'at_type' : at_type , 'ser_num' : ser_num , 'at_name' : at_name , 'at_id' : at_id , 'alt_loc' : alt_loc , 'res_name' : res_name , 'chain_id' : chain_id , 'res_id' : res_id , 'res_ic' : res_ic , 'h_flag' : h_flag , 'coords' : coords , 'occupancy' : occupancy , 'bfactor' : bfactor , 'seg_id' : seg_id , 'res_long_id' : res_long_id , 'at_long_id' : at_long_id , 'element' : element } return result
short_docstring: Parses a valid PDB line into an atomic dictionary.
short_docstring_tokens: Parses a valid PDB line into an atomic dictionary .
comment: """Parses a valid PDB line into an atomic dictionary."""$SEP$# numbers are ints's?$SEP$# " N B "$SEP$# "N B"$SEP$# always keep \s$SEP$# non standard is 4chars long$SEP$# pdb requirement int$SEP$# no float conversion necessery$SEP$# it gets loaded straight into an$SEP$# numpy array.$SEP$# this is the default$SEP$# hetatms get the het flag (it's not used for writing)$SEP$# SeMet are not ligands