bcgsc / tigmint

⛓ Correct misassemblies using linked AND long reads
https://bcgsc.github.io/tigmint/
GNU General Public License v3.0
54 stars 13 forks source link

samtools sort error (sort: invalid option -- 't') #5

Closed QiushiLi closed 6 years ago

QiushiLi commented 6 years ago

problem solved, just use the default brew installed version 1.7

schmitt8 commented 2 years ago

I am also having this problem. I'm using samtools version 1.10. The error appears to be with the -t flag of samtools sort command. Not sure how to proceed and would appreciate any pointers.

many thanks,

Jonathan

here is the part of the .err log:

[bwa_index] 721.67 seconds elapse.
[bwa_index] Update BWT... 5.70 sec
[bwa_index] Pack forward-only FASTA... 4.39 sec
[bwa_index] Construct SA from BWT and Occ... 351.30 sec
[main] Version: 0.7.15-r1140
[main] CMD: bwa index myassembly.fa
[main] Real time: 1093.401 sec; CPU: 1090.194 sec
sort: invalid option -- 't'
Usage: samtools sort [options...] [in.bam]
Options:
  -l INT     Set compression level, from 0 (uncompressed) to 9 (best)
  -m INT     Set maximum memory per thread; suffix K/M/G recognized [768M]
  -n         Sort by read name
  -o FILE    Write final output to FILE rather than standard output
  -T PREFIX  Write temporary files to PREFIX.nnnn.bam
  -@, --threads INT
             Set number of sorting and compression threads [1]
      --input-fmt-option OPT[=VAL]
               Specify a single input file format option in the form
               of OPTION or OPTION=VALUE
  -O, --output-fmt FORMAT[,OPT[=VAL]]...
               Specify output format (SAM, BAM, CRAM)
      --output-fmt-option OPT[=VAL]
               Specify a single output file format option in the form
               of OPTION or OPTION=VALUE
      --reference FILE
               Reference sequence FASTA FILE [null]
[M::bwa_idx_load_from_disk] read 0 ALT contigs
[M::process] read 1048036 sequences (120000122 bp)...
[M::process] 0 single-end sequences; 1048036 paired-end sequences
[M::process] read 1048036 sequences (120000122 bp)...
[M::mem_pestat] # candidate unique pairs for (FF, FR, RF, RR): (13246, 389386, 7476, 10144)
[M::mem_pestat] analyzing insert size distribution for orientation FF...
[M::mem_pestat] (25, 50, 75) percentile: (133, 208, 300)
[M::mem_pestat] low and high boundaries for computing mean and std.dev: (1, 634)
[M::mem_pestat] mean and std.dev: (219.73, 122.75)
[M::mem_pestat] low and high boundaries for proper pairs: (1, 801)
[M::mem_pestat] analyzing insert size distribution for orientation FR...
[M::mem_pestat] (25, 50, 75) percentile: (265, 327, 412)
[M::mem_pestat] low and high boundaries for computing mean and std.dev: (1, 706)
[M::mem_pestat] mean and std.dev: (341.12, 118.23)
[M::mem_pestat] low and high boundaries for proper pairs: (1, 853)
[M::mem_pestat] analyzing insert size distribution for orientation RF...
[M::mem_pestat] (25, 50, 75) percentile: (54, 126, 252)
[M::mem_pestat] low and high boundaries for computing mean and std.dev: (1, 648)
[M::mem_pestat] mean and std.dev: (156.21, 137.94)
[M::mem_pestat] low and high boundaries for proper pairs: (1, 846)
[M::mem_pestat] analyzing insert size distribution for orientation RR...
[M::mem_pestat] (25, 50, 75) percentile: (128, 204, 297)
[M::mem_pestat] low and high boundaries for computing mean and std.dev: (1, 635)
[M::mem_pestat] mean and std.dev: (214.31, 125.97)
[M::mem_pestat] low and high boundaries for proper pairs: (1, 804)
[M::mem_pestat] skip orientation FF
[M::mem_pestat] skip orientation RF
[M::mem_pestat] skip orientation RR
[M::mem_process_seqs] Processed 1048036 reads in 278.677 CPU sec, 27.984 real sec
make: *** [myassembly.myreads.sortbx.bam] Error 1

and here is the .out log

bwa index myassembly.fa
[bwt_gen] Finished constructing BWT in 284 iterations.
bwa mem -t12 -pC myassembly.fa myreads.fq.gz | samtools view -u -F4 | samtools sort -@12 -tBX -T$(mktemp -u -t myassembly.myreads.sortbx.bam.XXXXXX) -o myassembly.myreads.sortbx.bam
lcoombe commented 2 years ago

Hi @schmitt8,

That's strange - I have samtools v1.10 installed, and can see that the -t option is available:

[lcoombe@hpce705 ~]$ samtools sort
Usage: samtools sort [options...] [in.bam]
Options:
  -l INT     Set compression level, from 0 (uncompressed) to 9 (best)
  -m INT     Set maximum memory per thread; suffix K/M/G recognized [768M]
  -n         Sort by read name
  -t TAG     Sort by value of TAG. Uses position as secondary index (or read name if -n is set)
  -o FILE    Write final output to FILE rather than standard output
  -T PREFIX  Write temporary files to PREFIX.nnnn.bam
  --no-PG    do not add a PG line
      --input-fmt-option OPT[=VAL]
               Specify a single input file format option in the form
               of OPTION or OPTION=VALUE
  -O, --output-fmt FORMAT[,OPT[=VAL]]...
               Specify output format (SAM, BAM, CRAM)
      --output-fmt-option OPT[=VAL]
               Specify a single output file format option in the form
               of OPTION or OPTION=VALUE
      --reference FILE
               Reference sequence FASTA FILE [null]
  -@, --threads INT
               Number of additional threads to use [0]
      --verbosity INT
               Set level of verbosity
[lcoombe@hpce705 ~]$ samtools --version
samtools 1.10
Using htslib 1.10.2
Copyright (C) 2019 Genome Research Ltd.

Looking at the samtools release notes, the -t option has been available since v1.5. Could you double check the samtools version that Tigmint is using? Perhaps your PATH when launching Tigmint had an older samtools first?