jts / sga

de novo sequence assembler using string graphs
http://genome.cshlp.org/content/22/3/549
237 stars 82 forks source link

Samtools problem in sga-bam2de.pl #118

Closed Katospiegel closed 8 years ago

Katospiegel commented 8 years ago

Hi,

Trying to estimate the distances in the sorting sep with sga-bam2de.pl script I found this problem:

samtools sort libPE.diffcontigs.bam libPE.diffcontigs.sorted.bam
[bam_sort] Use -T PREFIX / -o FILE to specify temporary and final output files
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]

I think that is a problem with the samtools version. Trying with the 0.1.19 there is no problem but with the 1.3.1 is neccesary to add -o flag to the output in the script:

# sort 
$cmd = "samtools sort $prefix.diffcontigs.bam -o $prefix.diffcontigs.sorted";

Cheers

sjackman commented 8 years ago

I have run into this problem as well.

# sort 
$cmd = "samtools sort -\@$numThreads $prefix.diffcontigs.bam -o $prefix.diffcontigs.sorted.bam";
sjackman commented 8 years ago

Fixed by #123