This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Noob is stuck trying to use samtools fixmate

Hi there I'm trying to follow the instructions here

https://www.htslib.org/workflow/fastq.html

However when I get to the second step and input:

samtools fixmate -O bam,level=1 -m my.sam fixmate.bam

It tells me that level is an unknown option.

I tried stripping that part of the command so it ran

samtools fixmate -O -m my.sam fixmate.bam

However it just tells me:

Usage: samtools fixmate <in.nameSrt.bam> <out.nameSrt.bam>
Options:
  -r           Remove unmapped reads and secondary alignments
  -p           Disable FR proper pair check
  -c           Add template cigar ct tag
      --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]

As elsewhere in samtools, use '-' as the filename for stdin/stdout. The input
file must be grouped by read name (e.g. sorted by name). Coordinated sorted
input is not accepted.

I tried transposing the -O and -m switches out of desperation but that doesn't run either.

Does anybody perhaps know what I'm doing wrong? Thanks

samtools

From what I see, you stripped -O also off the BAM keyword, which is required. Might it be only that?

Thanks, I read it defaulted to bam without the keyword but following your advice I tried

 samtools fixmate -O bam -m my.sam fixmate.bam

It tells me that 'm' is an invalid option.

When I query samtools fixmate /? it says the only options are -r -p -c and -O

I ran samtools --version and it tells me I'm on 1.3.1 which I see is a version from 2016

I'll see if I can get the latest version installed and try again. Thanks.

1 answer

So my problem was that I'd installed samtools from the universe repository and it was a really old version.

Now I installed the latest version manually the instructions I was following actually work fine.

Damn you universe repository guy!

Log in to answer this question.