int main_samview(int argc, char *argv[])
{
int c, is_header = 0, is_header_only = 0, is_bamin = 1, ret = 0, compress_level = -1, is_bamout = 0, is_count = 0;
- int of_type = BAM_OFDEC, is_long_help = 0;
+ int of_type = BAM_OFDEC, is_long_help = 0, n_threads = 0;
int count = 0;
samfile_t *in = 0, *out = 0;
- char in_mode[5], out_mode[5], *fn_out = 0, *fn_list = 0, *fn_ref = 0, *fn_rg = 0;
+ char in_mode[5], out_mode[5], *fn_out = 0, *fn_list = 0, *fn_ref = 0, *fn_rg = 0, *q;
/* parse command-line options */
strcpy(in_mode, "r"); strcpy(out_mode, "w");
- while ((c = getopt(argc, argv, "SbBct:h1Ho:q:f:F:ul:r:xX?T:R:L:s:Q:")) >= 0) {
+ while ((c = getopt(argc, argv, "SbBct:h1Ho:q:f:F:ul:r:xX?T:R:L:s:Q:@:")) >= 0) {
switch (c) {
- case 's': g_subsam = atof(optarg); break;
+ case 's':
+ if ((g_subsam_seed = strtol(optarg, &q, 10)) != 0) {
+ srand(g_subsam_seed);
+ g_subsam_seed = rand();
+ }
+ g_subsam_frac = strtod(q, &q);
+ break;
case 'c': is_count = 1; break;
case 'S': is_bamin = 0; break;
case 'b': is_bamout = 1; break;