docs: def _construct_df(pdb_lines):
          """Construct DataFrames from list of PDB lines."""
          valids = tuple(pdb_records.keys())
          line_lists = {r: [] for r in valids}
          line_lists['OTHERS'] = []
          for line_num, line in enumerate(pdb_lines):
              if line.strip():
                  if line.startswith(valids):
                      record = line[:6].rstrip()
                      line_ele = ['' for _ in range(len(
                          pdb_records[record]) + 1)]
                      for idx, ele in enumerate(pdb_records[record]):
                          line_ele[idx] = (line[ele['line'][0]:ele['line'][1]]
                                           .strip())
                      line_ele[-1] = line_num
                      line_lists[record].append(line_ele)
                  else:
                      line_lists['OTHERS'].append([line[:6].rstrip(),
                                                  line[6:-1].rstrip(), line_num])
  
          dfs = {}
          for r in line_lists.items():
              df = pd.DataFrame(r[1], columns=[c['id'] for c in
                                               pdb_records[r[0]]] + ['line_idx'])
              for c in pdb_records[r[0]]:
                  try:
                      df[c['id']] = df[c['id']].astype(c['type'])
                  except ValueError:
                      # expect ValueError if float/int columns are empty strings
                      df[c['id']] = pd.Series(np.nan, index=df.index)
  
              dfs[r[0]] = df
          return dfs