Skip to content

Commit

Permalink
Update simulate.py
Browse files Browse the repository at this point in the history
changed Y_females[father_indices] to Y_females[mother_indices] on two lines it appears
  • Loading branch information
imahdimir authored Nov 7, 2023
1 parent bfc099c commit d835083
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions snipar/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def forward_sim(haps, maps, ngen_random, ngen_am, unlinked, n_causal, h2, v_indi
delta_p, delta_m, Y_p, Y_m = compute_phenotype(haps, causal, a, 1 - h2)
delta_p, delta_m, Y_p, Y_m = delta_p[father_indices], delta_m[mother_indices], Y_p[father_indices], Y_m[mother_indices]
else:
delta_p, delta_m, Y_p, Y_m = G_males[father_indices], G_females[mother_indices], Y_males[father_indices], Y_females[father_indices]
delta_p, delta_m, Y_p, Y_m = G_males[father_indices], G_females[mother_indices], Y_males[father_indices], Y_females[mother_indices]
# Compute phenotypes
print('Computing phenotypes')
if np.abs(beta_vert) > 0 and a_count>0:
Expand Down Expand Up @@ -541,7 +541,7 @@ def forward_sim(haps, maps, ngen_random, ngen_am, unlinked, n_causal, h2, v_indi
delta_p, delta_m, Y_p, Y_m = compute_phenotype(haps, causal, a, 1 - h2)
delta_p, delta_m, Y_p, Y_m = delta_p[father_indices], delta_m[mother_indices], Y_p[father_indices], Y_m[mother_indices]
else:
delta_p, delta_m, Y_p, Y_m = G_males[father_indices], G_females[mother_indices], Y_males[father_indices], Y_females[father_indices]
delta_p, delta_m, Y_p, Y_m = G_males[father_indices], G_females[mother_indices], Y_males[father_indices], Y_females[mother_indices]
# Compute phenotypes
print('Computing phenotypes')
if np.abs(beta_vert) > 0 and a_count>0:
Expand Down Expand Up @@ -629,4 +629,4 @@ def impute_all_fams_phased(haps,freqs,ibd):
for i in prange(haps.shape[0]):
for j in range(haps.shape[2]):
imp[i,j] = impute_from_sibs_phased(haps[i,0,j,:],haps[i,1,j,:],ibd[i,j,:],freqs[j])
return imp
return imp

0 comments on commit d835083

Please sign in to comment.