@@ -62,7 +62,7 @@ typedef struct
62
62
int ld_max_set [VCFBUF_LD_N ];
63
63
char * ld_annot [VCFBUF_LD_N ], * ld_annot_pos [VCFBUF_LD_N ], * cluster_annot ;
64
64
int ld_mask ;
65
- int argc , region_is_file , target_is_file , output_type , ld_filter_id , rand_missing , nsites , ld_win , rseed , clevel ;
65
+ int argc , region_is_file , target_is_file , output_type , ld_filter_id , rand_missing , nsites , ld_win , rseed , clevel , record_cmd_line ;
66
66
int max_cluster ;
67
67
char * nsites_mode ;
68
68
int keep_sites ;
@@ -93,6 +93,7 @@ static const char *usage_text(void)
93
93
" -a, --annotate count|LD|RD|r2 Annotate with the number of variants within the -w window (\"count\"),\n"
94
94
" or with the biggest LD, RD, or r2 value and the position of the record\n"
95
95
" -f, --set-filter STR Apply soft filter STR instead of discarding the site (only with -m)\n"
96
+ " --no-version Do not append version and command line to the header\n"
96
97
" -m, --max count|LD|RD|r2=NUM Remove clusters of more than NUM sites (\"count\") or sites with LD, RD, or r2 bigger than NUM\n"
97
98
" -n, --nsites-per-win N Keep at most N sites in the -w window. See also -N, --nsites-per-win-mode\n"
98
99
" -N, --nsites-per-win-mode STR Keep sites with biggest AF (\"maxAF\"); sites that come first (\"1st\"); pick randomly (\"rand\") [maxAF]\n"
@@ -195,6 +196,8 @@ static void init_data(args_t *args)
195
196
}
196
197
if ( args -> cluster_annot )
197
198
bcf_hdr_printf (args -> hdr ,"##INFO=<ID=%s,Number=1,Type=Integer,Description=\"The number of variants within %d bp of the site\">" ,args -> cluster_annot ,args -> ld_win );
199
+ if (args -> record_cmd_line )
200
+ bcf_hdr_append_version (args -> hdr , args -> argc , args -> argv , "bcftools_plugin_prune" );
198
201
if ( bcf_hdr_write (args -> out_fh , args -> hdr )!= 0 ) error ("[%s] Error: cannot write to %s\n" , __func__ ,args -> output_fname );
199
202
if ( init_index2 (args -> out_fh ,args -> hdr ,args -> output_fname ,
200
203
& args -> index_fn , args -> write_index )< 0 )
@@ -334,12 +337,14 @@ int run(int argc, char **argv)
334
337
args -> nsites_mode = "maxAF" ;
335
338
args -> rseed = time (NULL );
336
339
args -> clevel = -1 ;
340
+ args -> record_cmd_line = 1 ;
337
341
static struct option loptions [] =
338
342
{
339
343
{"keep-sites" ,no_argument ,NULL ,'k' },
340
344
{"randomize-missing" ,no_argument ,NULL ,1 },
341
345
{"AF-tag" ,required_argument ,NULL ,2 },
342
346
{"random-seed" ,required_argument ,NULL ,3 },
347
+ {"no-version" ,no_argument ,NULL ,4 },
343
348
{"exclude" ,required_argument ,NULL ,'e' },
344
349
{"include" ,required_argument ,NULL ,'i' },
345
350
{"annotate" ,required_argument ,NULL ,'a' },
@@ -371,6 +376,7 @@ int run(int argc, char **argv)
371
376
args -> rseed = strtol (optarg ,& tmp ,10 );
372
377
if ( tmp == optarg || * tmp ) error ("Could not parse: --random-seed %s\n" , optarg );
373
378
break ;
379
+ case 4 : args -> record_cmd_line = 0 ; break ;
374
380
case 'W' :
375
381
if (!(args -> write_index = write_index_parse (optarg )))
376
382
error ("Unsupported index format '%s'\n" , optarg );
0 commit comments