docs: def add_residue(structure, residue, phi=-120, psi_im1=140, omega=-370):
      '''Adds a residue to chain A model 0 of the given structure, and
      returns the new structure. The residue to be added can be specified
      in two ways: either as a geometry object (in which case
      the remaining arguments phi, psi_im1, and omega are ignored) or as a
      single-letter amino-acid code. In the latter case, the optional
      arguments phi, psi_im1, and omega specify the corresponding backbone
      angles.
      
      When omega is specified, it needs to be a value greater than or equal
      to -360. Values below -360 are ignored.''' 
      
      if isinstance( residue, Geo ):
          geo = residue
      else:
          geo=geometry(residue) 
          geo.phi=phi
          geo.psi_im1=psi_im1
          if omega>-361:
              geo.omega=omega
      
      add_residue_from_geo(structure, geo)
      return structure