code: def run_phenolog(ont, aset, args):
      
      ofactory = OntologyFactory()
      ont2 = ofactory.create(args.resource2)
  
      afactory = AssociationSetFactory()
      aset2 = afactory.create(ontology=ont2,
                              file=args.file2)
  
      # only test for genes (or other subjects of statements) in common
      common = set(aset.subjects).intersection(aset2.subjects)
      num_common = len(common)
      logging.info("Genes in common between two KBs: {}/\{} = {}".format(len(aset.subjects), len(aset2.subjects), num_common))
      if num_common < 2:
          logging.error("TOO FEW")
          return None
      for n in aset.ontology.nodes():
          nl = ont.label(n, id_if_null=True)
          genes = aset.query([n])
          num_genes = len(genes)
          if num_genes > 2:
              logging.info("BASE: {} {} num={}".format(n,nl, num_genes))
              enr = aset2.enrichment_test(subjects=genes, background=aset2.subjects, labels=True)
              for r in enr:
                  print("{:8.3g} {} {:20s} <-> {} {:20s}".format(r['p'],n,nl,r['c'],str(r['n'])))
docs: Like run_enrichment_test, but uses classes from a 2nd ontology/assocset to build the gene set.