code: def test_pc_relate_simple_example():
      gs = hl.literal(
          [
              [0, 0, 0, 0, 1, 1, 1, 1],
              [0, 0, 1, 1, 0, 0, 1, 1],
              [0, 1, 0, 1, 0, 1, 0, 1],
              [0, 0, 1, 1, 0, 0, 1, 1],
          ]
      )
      scores = hl.literal([[1, 1], [-1, 0], [1, -1], [-1, 0]])
      mt = hl.utils.range_matrix_table(n_rows=8, n_cols=4)
      mt = mt.annotate_entries(
          GT=hl.unphased_diploid_gt_index_call(
              gs[mt.col_idx][mt.row_idx]
          )
      )
      mt = mt.annotate_cols(scores=scores[mt.col_idx])
      pcr = hl.pc_relate(
          mt.GT, min_individual_maf=0, scores_expr=mt.scores
      )
  
      expected = [
          hl.Struct(i=0, j=1, kin=0.0, ibd0=1.0, ibd1=0.0, ibd2=0.0),
          hl.Struct(i=0, j=2, kin=0.0, ibd0=1.0, ibd1=0.0, ibd2=0.0),
          hl.Struct(i=0, j=3, kin=0.0, ibd0=1.0, ibd1=0.0, ibd2=0.0),
          hl.Struct(i=1, j=2, kin=0.0, ibd0=1.0, ibd1=0.0, ibd2=0.0),
          hl.Struct(i=1, j=3, kin=0.0, ibd0=1.0, ibd1=0.0, ibd2=0.0),
          hl.Struct(i=2, j=3, kin=0.0, ibd0=1.0, ibd1=0.0, ibd2=0.0),
      ]
      ht_expected = hl.Table.parallelize(expected)
      ht_expected = ht_expected.key_by(
          i=hl.struct(col_idx=ht_expected.i),
          j=hl.struct(col_idx=ht_expected.j),
      )
      assert ht_expected._same(pcr, tolerance=1e-12, absolute=True)
  
file_path: hail/hail/python/test/hail/methods/relatedness/test_pc_relate.py
imports: import hail
  from ...helpers import resource, skip_when_service_backend, test_timeout, skip_when_service_backend_in_azure, qobtest
label_desc: Use image node_id 2 for calling a global function with example usage: test_pc_relate_simple_example() without return types