Question: error in getting sorted bam
0
gravatar for A
4.2 years ago by
A3.5k
A3.5k wrote:

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]$ 

 

ribo-seq sam bam bowtie2 myposts • 1.7k views
ADD COMMENTlink modified 4.2 years ago by michael.ante3.4k • written 4.2 years ago by A3.5k
4
gravatar for h.mon
4.2 years ago by
h.mon27k
Brazil
h.mon27k wrote:

Try:

$SAM/samtools sort eg1_highquality.bam eg1_highquality_sorted

ADD COMMENTlink written 4.2 years ago by h.mon27k

thanksssssssssssssssss it worked, long time i was working with 

ADD REPLYlink modified 4.2 years ago • written 4.2 years ago by A3.5k
3
gravatar for michael.ante
4.2 years ago by
michael.ante3.4k
Austria/Vienna
michael.ante3.4k wrote:

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 COMMENTlink written 4.2 years ago by michael.ante3.4k

thank you also

ADD REPLYlink written 4.2 years ago by A3.5k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 724 users visited in the last hour