Skip to content

Commit f84f74f

Browse files
Seemingly working version using DB.
Probably some perf bottlenecks, but OK for now.
1 parent 13e23c6 commit f84f74f

File tree

2 files changed

+115
-155
lines changed

2 files changed

+115
-155
lines changed

sc2ts/cli.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,6 @@ def dump_samples(samples, output_file):
199199
"is greater than this, randomly subsample."
200200
),
201201
)
202-
@click.option(
203-
"--excluded_samples_dir",
204-
default=None,
205-
type=click.Path(file_okay=False, dir_okay=True),
206-
help=(
207-
"Directory containing pickled files of excluded samples. "
208-
"By default, it is set to output_prefx."
209-
),
210-
)
211202
@click.option("--num-threads", default=0, type=int, help="Number of match threads")
212203
@click.option("--random-seed", default=42, type=int, help="Random seed for subsampling")
213204
@click.option("-p", "--precision", default=None, type=int, help="Match precision")
@@ -225,7 +216,6 @@ def daily_extend(
225216
num_past_days,
226217
max_submission_delay,
227218
max_daily_samples,
228-
excluded_samples_dir,
229219
num_threads,
230220
random_seed,
231221
precision,
@@ -238,20 +228,18 @@ def daily_extend(
238228
"""
239229
setup_logging(verbose, log_file)
240230
rng = random.Random(random_seed)
231+
241232
match_db_path = f"{output_prefix}match.db"
242233
if base is None:
243234
base_ts = inference.initial_ts()
244235
match_db = inference.MatchDb.initialise(match_db_path)
245236
else:
246237
base_ts = tskit.load(base)
247-
match_db = inference.MatchDb(match_db_path)
248-
249-
if excluded_samples_dir is None:
250-
excluded_samples_dir = output_prefix
251238

252239
with contextlib.ExitStack() as exit_stack:
253240
alignment_store = exit_stack.enter_context(sc2ts.AlignmentStore(alignments))
254241
metadata_db = exit_stack.enter_context(sc2ts.MetadataDb(metadata))
242+
match_db = exit_stack.enter_context(inference.MatchDb(match_db_path))
255243
ts_iter = inference.daily_extend(
256244
alignment_store=alignment_store,
257245
metadata_db=metadata_db,
@@ -267,13 +255,10 @@ def daily_extend(
267255
precision=precision,
268256
num_threads=num_threads,
269257
show_progress=not no_progress,
270-
excluded_sample_dir=excluded_samples_dir,
271258
)
272259
for ts, date in ts_iter:
273260
output_ts = output_prefix + date + ".ts"
274261
add_provenance(ts, output_ts)
275-
# output_excluded_samples = output_prefix + date + ".excluded_samples.pickle"
276-
# dump_samples(excluded_samples, output_excluded_samples)
277262

278263

279264
@click.command()

0 commit comments

Comments
 (0)