code: def getpeptides(self, chain):
          
          all_from_chain = [o for o in pybel.ob.OBResidueIter(
              self.proteincomplex.OBMol) if o.GetChain() == chain]  # All residues from chain
          if len(all_from_chain) == 0:
              return None
          else:
              non_water = [o for o in all_from_chain if not o.GetResidueProperty(9)]
              ligand = self.extract_ligand(non_water)
              return ligand
docs: If peptide ligand chains are defined via the command line options,
          try to extract the underlying ligand formed by all residues in the
          given chain without water