From f6509d17cbb2b58741c54558d3761fa8e30dfae9 Mon Sep 17 00:00:00 2001 From: szhan Date: Thu, 23 May 2024 14:02:35 +0100 Subject: [PATCH] Minor edits to comments --- tests/lsbase.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/lsbase.py b/tests/lsbase.py index 8cec604..cd5711a 100644 --- a/tests/lsbase.py +++ b/tests/lsbase.py @@ -77,7 +77,8 @@ def get_examples_diploid(self, ts, include_ancestors): raise NotImplementedError ref_panel = ts.genotype_matrix() num_sites = ref_panel.shape[0] - # Queries are unphased genotypes (calculated as allele dosages). + # Take some haplotypes as queries from the reference panel. + # Note that the queries contain unphased genotypes (calculated as allele dosages). query1 = ref_panel[:, 0].reshape(1, num_sites) query1 += ref_panel[:, 1].reshape(1, num_sites) query2 = ref_panel[:, -2].reshape(1, num_sites) @@ -90,11 +91,11 @@ def get_examples_diploid(self, ts, include_ancestors): query_miss_most = query1.copy() query_miss_most[0, 1:] = core.MISSING queries = [query1, query2, query_miss_last, query_miss_mid, query_miss_most] - # Remove queries from the reference panel. + # Exclude the arbitrarily chosen queries from the reference panel. ref_panel = ref_panel[:, 2:-2] - ref_panel_size = ref_panel.shape[1] - # Reference panel contains unphased genotypes. - G = np.zeros((num_sites, ref_panel_size, ref_panel_size)) + num_ref_haps = ref_panel.shape[1] # Haplotypes, not individuals. + # Reference panel contains phased genotypes. + G = np.zeros((num_sites, num_ref_haps, num_ref_haps)) for i in range(num_sites): G[i, :, :] = np.add.outer(ref_panel[i, :], ref_panel[i, :]) return ref_panel, G, queries