error in getting sorted bam
2
0
Entering edit mode
8.7 years ago
zizigolu ★ 4.3k

Hey friends,

I have a filename_highquality.bam, by this syntax I want to change it to sorted bam but I got error, what I did wrong please?

$SAM/samtools sort eg1_highquality.bam > eg1_highquality_sorted.bam

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
  -O FORMAT  Write output as FORMAT ('sam'/'bam'/'cram')   (either -O or
  -T PREFIX  Write temporary files to PREFIX.nnnn.bam       -T is required)
  -@ INT     Set number of sorting and compression threads [1]

Legacy usage: samtools sort [options...] <in.bam> <out.prefix>
Options:
  -f         Use <out.prefix> as full final filename rather than prefix
  -o         Write final output to stdout rather than <out.prefix>.bam
  -l,m,n,@   Similar to corresponding options above
[izadi@lbox161 izadi]$ $SAM/samtools sort eg1_highquality.bam > eg1_highquality_sorted.bam
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
  -O FORMAT  Write output as FORMAT ('sam'/'bam'/'cram')   (either -O or
  -T PREFIX  Write temporary files to PREFIX.nnnn.bam       -T is required)
  -@ INT     Set number of sorting and compression threads [1]

Legacy usage: samtools sort [options...] <in.bam> <out.prefix>
Options:
  -f         Use <out.prefix> as full final filename rather than prefix
  -o         Write final output to stdout rather than <out.prefix>.bam
  -l,m,n,@   Similar to corresponding options above
[izadi@lbox161 izadi]$
sam bam ribo-seq bowtie2 • 3.0k views
ADD COMMENT
4
Entering edit mode
8.7 years ago
h.mon 35k

Try:

$SAM/samtools sort eg1_highquality.bam eg1_highquality_sorted
ADD COMMENT
0
Entering edit mode

Thanks, it worked, long time I was working with

ADD REPLY
3
Entering edit mode
8.7 years ago
michael.ante ★ 3.8k

Just use the standard (in your output legacy use) samtools sort command:

samtools sort eg1_highquality.bam  eg1_highquality_sorted

It'll create a file called eg1_highquality_sorted.bam

ADD COMMENT
0
Entering edit mode

thank you also

ADD REPLY

Login before adding your answer.

Traffic: 2734 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6