From c2312c0de019bfc5c69225cdb7ee858cf5eb9869 Mon Sep 17 00:00:00 2001 From: "Leonardo de Oliveira Martins (QIB)" Date: Wed, 14 Apr 2021 14:40:55 +0100 Subject: [PATCH] create index thread safe --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.c b/src/main.c index b92df75..89bb9f9 100644 --- a/src/main.c +++ b/src/main.c @@ -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) {