Skip to content

Commit

Permalink
fix: issue where breakpoints weren't outputting (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlamkin7 authored Nov 10, 2022
1 parent 7c90355 commit ff90bff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions haptools/sim_genotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ def write_breakpoints(samples, breakpoints, out):

# randomly sample breakpoints to get the correct amount of samples to output
breakpoints = np.array(breakpoints, dtype=object)
breakpoints = np.random.choice(breakpoints, size=2*samples, replace=False)
breakpoints_ind = np.random.choice(range(breakpoints.shape[0]), size=2*samples, replace=False)
breakpoints = breakpoints[breakpoints_ind, :]

with open(breakpt_file, 'w') as output:
for ind, sample in enumerate(breakpoints):
Expand Down Expand Up @@ -852,7 +853,7 @@ def validate_params(model, mapdir, chroms, popsize, invcf, sample_info, region=N

# Complete check if we're only outputting a breakpoint
if only_bp:
return
return popsize

# Collect samples from vcf
try:
Expand Down

0 comments on commit ff90bff

Please sign in to comment.