docstr: Creates 1-letter amino acid codes from DataFrame
  
  Non-canonical amino-acids are converted as follows:
  ASH (protonated ASP) => D
  CYX (disulfide-bonded CYS) => C
  GLH (protonated GLU) => E
  HID/HIE/HIP (different protonation states of HIS) = H
  HYP (hydroxyproline) => P
  MSE (selenomethionine) => M
  
  Parameters
  ----------
  record : str, default: 'ATOM'
      Specfies the record DataFrame.
  residue_col : str,  default: 'residue_name'
      Column in `record` DataFrame to look for 3-letter amino acid
      codes for the conversion.
  fillna : str, default: '?'
      Placeholder string to use for unknown amino acids.
  
  Returns
  ---------
  pandas.DataFrame : Pandas DataFrame object consisting of two columns,
      `'chain_id'` and `'residue_name'`, where the former contains
      the chain ID of the amino acid and the latter
      contains the 1-letter amino acid code, respectively.
docstr_tok: ["Creates","1-letter","amino","acid","codes","from","DataFrame","Non-canonical","amino-acids","are","converted","as","follows",":","ASH","(","protonated","ASP",")","=",">","D","CYX","(","disulfide-bonded","CYS",")","=",">","C","GLH","(","protonated","GLU",")","=",">","E","HID\/HIE\/HIP","(","different","protonation","states","of","HIS",")","=","H","HYP","(","hydroxyproline",")","=",">","P","MSE","(","selenomethionine",")","=",">","M","Parameters","--","--","--","--","--","record",":","str",",","default",":","'ATOM'","Specfies","the","record","DataFrame",".","residue_col",":","str",",","default",":","'residue_name'","Column","in","`","record","`","DataFrame","to","look","for","3-letter","amino","acid","codes","for","the","conversion",".","fillna",":","str",",","default",":","'","?","'","Placeholder","string","to","use","for","unknown","amino","acids",".","Returns","--","--","--","--","-","pandas.DataFrame",":","Pandas","DataFrame","object","consisting","of","two","columns",",","`","'chain_id","'","`","and","`","'residue_name","'","`",",","where","the","former","contains","the","chain","ID","of","the","amino","acid","and","the","latter","contains","the","1-letter","amino","acid","code",",","respectively","."]
code: def amino3to1(
      self,
      record: str = "ATOM",
      residue_col: str = "auth_comp_id",
      residue_number_col: str = "auth_seq_id",
      chain_col: str = "auth_asym_id",
      fillna: str = "?",
  ):
      """Creates 1-letter amino acid codes from DataFrame
  
      Non-canonical amino-acids are converted as follows:
      ASH (protonated ASP) => D
      CYX (disulfide-bonded CYS) => C
      GLH (protonated GLU) => E
      HID/HIE/HIP (different protonation states of HIS) = H
      HYP (hydroxyproline) => P
      MSE (selenomethionine) => M
  
      Parameters
      ----------
      record : str, default: 'ATOM'
          Specfies the record DataFrame.
      residue_col : str,  default: 'residue_name'
          Column in `record` DataFrame to look for 3-letter amino acid
          codes for the conversion.
      fillna : str, default: '?'
          Placeholder string to use for unknown amino acids.
  
      Returns
      ---------
      pandas.DataFrame : Pandas DataFrame object consisting of two columns,
          `'chain_id'` and `'residue_name'`, where the former contains
          the chain ID of the amino acid and the latter
          contains the 1-letter amino acid code, respectively.
  
      """
      tmp = self.df[record]
      cmp = "placeholder"
      indices = []
  
      residue_number_insertion = (
          tmp[residue_number_col].astype(str) + tmp["pdbx_PDB_ins_code"]
      )
  
      for num, ind in zip(
          residue_number_insertion, np.arange(tmp.shape[0])
      ):
          if num != cmp:
              indices.append(ind)
          cmp = num
  
      transl = (
          tmp.iloc[indices][residue_col]
          .map(amino3to1dict)
          .fillna(fillna)
      )
  
      return pd.concat((tmp.iloc[indices][chain_col], transl), axis=1)
  
imports: import gzip
  import sys
  import warnings
  from typing import Dict, List, Optional
  from urllib.error import HTTPError, URLError
  from urllib.request import urlopen
  import numpy
  import pandas
  from looseversion import LooseVersion
  from ..pdb.engines import amino3to1dict
  from ..pdb.pandas_pdb import PandasPdb
  from .engines import ANISOU_DF_COLUMNS, MMCIF_PDB_COLUMN_MAP, MMCIF_PDB_NONEFIELDS, PDB_COLUMN_ORDER, mmcif_col_types
  from .mmcif_parser import load_cif_data
label_desc: Use image node_id 16 for calling the PandasMmcif obj's underlying member method code with example usage: obj.amino3to1(record, residue_col, residue_number_col, chain_col, fillna) and returns: pd