katholt / srst2

Short Read Sequence Typing for Bacterial Pathogens
Other
123 stars 65 forks source link

--threads param not getting passed to samtools? #91

Closed russellsmithies closed 7 years ago

russellsmithies commented 7 years ago

I notice that when I run srst2 multi-threaded that the --threads param gets passed to bowtie2 correctly but it appears that "samtools sort" and "samtools view" only run in a single thread whereas I'd have thought it should run with something like "samtools sort --threads $threads" I'm using srst2 0.2.0 and samtools 1.4.

Here's abbreviated log output:

07/12/2017 09:01:07 program started 07/12/2017 09:01:07 command line: /usr/bin/srst2 --threads 36 --input_pe 16ER2194_R1.fastq.gz 16ER2194_R2.fastq.gz --forward _R1 --reverse _R2 --output 16ER2194_Vi --log --gene_db Salmonella_VF_clustered.fasta 07/12/2017 09:01:07 Total paired readsets found:1 07/12/2017 09:01:07 Building bowtie2 index for Salmonella_VF_clustered.fasta... 07/12/2017 09:01:07 Running: bowtie2-build Salmonella_VF_clustered.fasta Salmonella_VF_clustered.fasta 07/12/2017 09:01:11 Processing database Salmonella_VF_clustered.fasta 07/12/2017 09:01:11 Running: samtools faidx Salmonella_VF_clustered.fasta ---chomp --- 07/12/2017 09:01:11 Processing sample 16ER2194 07/12/2017 09:01:11 Starting mapping with bowtie2 07/12/2017 09:01:11 Output prefix set to: 16ER2194_Vi16ER2194.Salmonella_VF_clustered 07/12/2017 09:01:11 Aligning reads to index Salmonella_VF_clustered.fasta using bowtie2... 07/12/2017 09:01:11 Running: bowtie2 -1 16ER2194_R1.fastq.gz -2 16ER2194_R2.fastq.gz -S 16ER2194_Vi__16ER2194.Salmonella_VF_clustered.sam -q --very-sensitive-local --no-unal -a -x Salmonella_VF_clustered.fasta --threads 36 07/12/2017 09:02:00 Processing Bowtie2 output with SAMtools... 07/12/2017 09:02:00 Generate and sort BAM file... 07/12/2017 09:02:00 Running: samtools view -b -o 16ER2194_Vi16ER2194.Salmonella_VF_clustered.unsorted.bam -q 1 -S 16ER2194_Vi16ER2194.Salmonella_VF_clustered.sam.mod 07/12/2017 09:02:06 Running: samtools sort 16ER2194_Vi__16ER2194.Salmonella_VF_clustered.unsorted.bam 16ER2194_Vi16ER2194.Salmonella_VF_clustered.sorted 07/12/2017 09:02:15 Deleting sam and bam files that are not longer needed... 07/12/2017 09:02:15 Deleting 16ER2194_Vi16ER2194.Salmonella_VF_clustered.sam 07/12/2017 09:02:15 Deleting 16ER2194_Vi__16ER2194.Salmonella_VF_clustered.sam.mod 07/12/2017 09:02:16 Deleting 16ER2194_Vi16ER2194.Salmonella_VF_clustered.unsorted.bam 07/12/2017 09:02:16 Generate pileup... 07/12/2017 09:02:16 Running: samtools mpileup -L 1000 -f Salmonella_VF_clustered.fasta -Q 20 -q 1 -B 16ER2194_Vi16ER2194.Salmonella_VF_clustered.sorted.bam 07/12/2017 09:02:20 Processing SAMtools pileup... 07/12/2017 09:02:53 Scoring alleles... 07/12/2017 09:03:45 Printing verbose gene detection results to 16ER2194_VifullgenesSalmonella_VF_clustered__results.txt 07/12/2017 09:03:50 261 genes identified in 16ER2194 07/12/2017 09:03:50 Finished processing for read set 16ER2194 ... 07/12/2017 09:03:50 Tabulating results for database Salmonella_VF_clustered.fasta ... 07/12/2017 09:03:50 Finished processing for database Salmonella_VF_clustered.fasta ... 07/12/2017 09:03:50 Gene detection output printed to 16ER2194_VigenesSalmonella_VF_clusteredresults.txt 07/12/2017 09:03:50 SRST2 has finished.

russellsmithies commented 7 years ago

Turns out I was accidentally using samtools 0.1.18, when I switched to a newer version the issue was resolved :-) I'd suggest changing the recommended version to something like 1.3 rather than 0.1.18 as the earlier versions mean you're not running multi-threaded.