code: def test_ld_score_regression_1(self):
      ht_50_irnt = self.get_ht_50_irnt()
      ht_20160 = self.get_ht_20160()
  
      ht = ht_50_irnt.union(ht_20160)
      mt = ht.to_matrix_table(
          row_key=["locus", "alleles"],
          col_key=["phenotype"],
          row_fields=["ld_score"],
          col_fields=[],
      )
  
      mt_tmp = new_temp_file()
      mt.write(mt_tmp, overwrite=True)
      mt = hl.read_matrix_table(mt_tmp)
  
      ht_results = hl.experimental.ld_score_regression(
          weight_expr=mt["ld_score"],
          ld_score_expr=mt["ld_score"],
          chi_sq_exprs=mt["chi_squared"],
          n_samples_exprs=mt["n"],
          n_blocks=20,
          two_step_threshold=5,
          n_reference_panel_variants=1173569,
      )
  
      results = {
          x["phenotype"]: {
              "mean_chi_sq": x["mean_chi_sq"],
              "intercept_estimate": x["intercept"]["estimate"],
              "intercept_standard_error": x["intercept"][
                  "standard_error"
              ],
              "snp_heritability_estimate": x["snp_heritability"][
                  "estimate"
              ],
              "snp_heritability_standard_error": x["snp_heritability"][
                  "standard_error"
              ],
          }
          for x in ht_results.collect()
      }
  
      self.assertAlmostEqual(
          results["50_irnt"]["mean_chi_sq"], 3.4386, places=4
      )
      self.assertAlmostEqual(
          results["50_irnt"]["intercept_estimate"], 0.7727, places=4
      )
      self.assertAlmostEqual(
          results["50_irnt"]["intercept_standard_error"],
          0.2461,
          places=4,
      )
      self.assertAlmostEqual(
          results["50_irnt"]["snp_heritability_estimate"],
          0.3845,
          places=4,
      )
      self.assertAlmostEqual(
          results["50_irnt"]["snp_heritability_standard_error"],
          0.1067,
          places=4,
      )
  
      self.assertAlmostEqual(
          results["20160"]["mean_chi_sq"], 1.5209, places=4
      )
      self.assertAlmostEqual(
          results["20160"]["intercept_estimate"], 1.2109, places=4
      )
      self.assertAlmostEqual(
          results["20160"]["intercept_standard_error"], 0.2238, places=4
      )
      self.assertAlmostEqual(
          results["20160"]["snp_heritability_estimate"],
          0.0486,
          places=4,
      )
      self.assertAlmostEqual(
          results["20160"]["snp_heritability_standard_error"],
          0.0416,
          places=4,
      )
  
imports: import numpy
  import hail
  import unittest
  import pytest
  from ..helpers import *
  from hail.utils import new_temp_file
label_desc: Use image node_id 8 for calling the Tests obj's underlying member method code with example usage: obj.test_ld_score_regression_1() without return types