Skip to content

Commit

Permalink
create index thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
leomrtns committed Apr 14, 2021
1 parent b4051e6 commit c2312c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ get_options_from_argtable (arg_parameters params)
"reference genome sequence(s) that match the GFF3 features, or you should find a GFF3 file with a '##FASTA' section at the end.\n");
}

// create index here to make sure it is done only once (not inside threads)
char *s = save_bwa_index (opt.reference_fasta_filename, NULL, false); // returns file name with suffix (NULL in our case)
if (s) free (s);

opt.paired_end = (params.paired->count? true: false);
opt.n_samples = (params.paired->count? params.fastq->count/2: params.fastq->count);
if (opt.n_samples < 2) {
Expand Down

0 comments on commit c2312c0

Please sign in to comment.