@@ -181,6 +181,38 @@ def add_provenance(ts, output_file):
181
181
logger .info (f"Wrote { output_file } " )
182
182
183
183
184
+ @click .command ()
185
+ @click .argument ("ts" , type = click .Path (dir_okay = False ))
186
+ @click .argument ("match_db" , type = click .Path (dir_okay = False ))
187
+ @click .option (
188
+ "--additional-problematic-sites" ,
189
+ default = None ,
190
+ type = click .Path (exists = True , dir_okay = False ),
191
+ help = "File containing the list of additional problematic sites to exclude." ,
192
+ )
193
+ @click .option ("-v" , "--verbose" , count = True )
194
+ @click .option ("-l" , "--log-file" , default = None , type = click .Path (dir_okay = False ))
195
+ def initialise (ts , match_db , additional_problematic_sites , verbose , log_file ):
196
+ """
197
+ Initialise a new base tree sequence to begin inference.
198
+ """
199
+ setup_logging (verbose , log_file )
200
+
201
+ additional_problematic = []
202
+ if additional_problematic_sites is not None :
203
+ additional_problematic = (
204
+ np .loadtxt (additional_problematic_sites ).astype (int ).tolist ()
205
+ )
206
+ logger .info (
207
+ f"Excluding additional { len (additional_problematic )} problematic sites"
208
+ )
209
+
210
+ base_ts = inference .initial_ts (additional_problematic )
211
+ base_ts .dump (ts )
212
+ logger .info (f"New base ts at { ts } " )
213
+ inference .MatchDb .initialise (match_db )
214
+
215
+
184
216
@click .command ()
185
217
@click .argument ("alignments" , type = click .Path (exists = True , dir_okay = False ))
186
218
@click .argument ("metadata" , type = click .Path (exists = True , dir_okay = False ))
@@ -202,7 +234,6 @@ def add_provenance(ts, output_file):
202
234
default = 10 ,
203
235
type = int ,
204
236
help = "Minimum size of groups of reconsidered samples" ,
205
- show_default = True
206
237
)
207
238
@click .option (
208
239
"--num-past-days" ,
@@ -477,6 +508,7 @@ def cli():
477
508
cli .add_command (export_alignments )
478
509
cli .add_command (export_metadata )
479
510
511
+ cli .add_command (initialise )
480
512
cli .add_command (daily_extend )
481
513
cli .add_command (validate )
482
514
cli .add_command (annotate_recombinants )
0 commit comments