Historically samtools sort also accepted a less flexible way of specifying the final and temporary output filenames:
samtools sort [-f] [-o] in.bam out.prefix
This has now been removed. The previous out.prefix argument (and -f option, if any) should be changed to an appropriate combination of -T PREFIX and -o FILE. The previous -o option should be removed, as output defaults to standard output
So bwa-meth.py doesn't work with latest samtools. It can fail with different kinds of errors:
AssertionError
Exception: bad or empty fastqs
IOError: [Errno 32] Broken pipe (most likely same problem as in issue #18)
In version 1.3 samtools deleted some deprecated CLI options for "samtools sort" command (see http://www.htslib.org/doc/samtools-1.3.html) :
So bwa-meth.py doesn't work with latest samtools. It can fail with different kinds of errors:
Details:
AssertionError
$ bwameth.py --reference /indexes/hg38.fa --threads 20 --prefix issue18 ./foo.fastq
:Where foo.fastq is fastq content suggested in #18
Exception: bad or empty fastqs
bwameth.py --reference /indexes/hg38.fa --threads 20 --prefix SRR033942 ./GSM491349/sra/SRX015763/SRR033942/SRR033942.sra
IOError: [Errno 32] Broken pipe
bwameth.py --reference /indexes/hg38.fa --threads 20 --prefix //GSE19418_tmp/GSM491349/SRR033987_hg38 //GSE19418_tmp/GSM491349/tmp/SRR033987.fastq.gz
Solution, just use new API, available at least since 1.0 (http://www.htslib.org/doc/samtools-1.0.html)
My fixes: https://github.com/iromeo/bwa-meth/commit/c45210d87fd985bb7443ba2f34615645ea46c7b8 and https://github.com/iromeo/bwa-meth/commit/0a1703b9e9ccaec36b4c4b9b9346d3126218744c