Skip to content

Commit

Permalink
Minor edits to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed May 23, 2024
1 parent e25b505 commit f6509d1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/lsbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit f6509d1

Please sign in to comment.