class_docstr: Object for working with Protein Databank structure files.
  
  Attributes
  ----------
  df : dict
      Dictionary storing pandas DataFrames for PDB record sections.
      The dictionary keys are {'ATOM', 'HETATM', 'ANISOU', 'OTHERS'}
      where 'OTHERS' contains all entries that are not parsed as
      'ATOM', 'HETATM', or 'ANISOU'.
  
  pdb_text : str
      PDB file contents in raw text format.
  
  pdb_path : Union[str, os.PathLike]
      Location of the PDB file that was read in via `read_pdb`
      or URL of the page where the PDB content was fetched from
      if `fetch_pdb` was called.
  
  header : str
      PDB file description.
  
  code : str
      PDB code
class_docstr_tok: ["Object","for","working","with","Protein","Databank","structure","files",".","Attributes","--","--","--","--","--","df",":","dict","Dictionary","storing","pandas","DataFrames","for","PDB","record","sections",".","The","dictionary","keys","are","{","'ATOM","'",",","'HETATM","'",",","'ANISOU","'",",","'OTHERS","'","}","where","'OTHERS","'","contains","all","entries","that","are","not","parsed","as","'ATOM","'",",","'HETATM","'",",","or","'ANISOU","'",".","pdb_text",":","str","PDB","file","contents","in","raw","text","format",".","pdb_path",":","Union","[","str",",","os.PathLike","]","Location","of","the","PDB","file","that","was","read","in","via","`","read_pdb","`","or","URL","of","the","page","where","the","PDB","content","was","fetched","from","if","`","fetch_pdb","`","was","called",".","header",":","str","PDB","file","description",".","code",":","str","PDB","code"]
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'
      Specifies 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'","Specifies","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="ATOM", residue_col="residue_name", fillna="?"
  ):
      """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'
          Specifies 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"].astype(str) + tmp["insertion"]
      )
  
      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_id"], transl), axis=1)
  
imports: from __future__ import annotations
  import gzip
  import sys
  import warnings
  import textwrap
  from copy import deepcopy
  from io import StringIO
  from typing import List, Optional
  from urllib.error import HTTPError, URLError
  from urllib.request import urlopen
  from warnings import warn
  import numpy
  import pandas
  from looseversion import LooseVersion
  from .engines import amino3to1dict, pdb_df_columns, pdb_records
  from biopandas.constants import ATOMIC_MASSES
label_desc: Use image node_id 22 for calling the PandasPdb obj's underlying member method code with example usage: obj.amino3to1(record, residue_col, fillna) and returns: pd