code: def compare_to_regenie(
      output_prefix, glowgr_df, compare_all_cols=True, num_snps=100
  ):
      regenie_files = [
          test_data_dir + output_prefix + "Y1.regenie",
          test_data_dir + output_prefix + "Y2.regenie",
      ]
      regenie_traits = ["Y1", "Y2"]
      regenie_df = pd.concat(
          [
              _read_regenie_df(f, t, num_snps)
              for f, t in zip(regenie_files, regenie_traits)
          ],
          ignore_index=True,
      )
      regenie_df["pvalue"] = np.power(10, -regenie_df["LOG10P"])
  
      glowgr_df["ID"] = glowgr_df["names"].apply(lambda x: str(x[-1]))
      glowgr_df = glowgr_df.rename(
          columns={"effect": "BETA", "stderror": "SE"}
      )
  
      regenie_df = regenie_df.set_index(["ID", "phenotype"])
      glowgr_df = glowgr_df.set_index(["ID", "phenotype"]).reindex(
          regenie_df.index
      )
  
      if compare_all_cols:
          cols = ["BETA", "SE", "pvalue"]
      else:
          cols = ["pvalue"]
      assert np.isclose(
          glowgr_df[cols].to_numpy(),
          regenie_df[cols].to_numpy(),
          rtol=1e-2,
          atol=1e-3,
      ).all()
  
file_path: glow/python/glow/gwas/tests/functions.py
imports: import glow.functions
  import numpy
  import pandas
  from pandas.testing import assert_frame_equal
label_desc: Use image node_id 5 for calling a global function with example usage: compare_to_regenie(output_prefix, glowgr_df, compare_all_cols, num_snps) without return types