how to use samtools sort correctly?
3
0
Entering edit mode
6.4 years ago

hi everyone, I have a question: I run the following command in the samtools sorted and failed to created the output file:

$Samtools sort -n $Temp/$i.out/accepted_hits.bam -o $oDirectory/$i.out/accepted_hits_sorted.bam

and the error it's:

[sort_blocks] fail to create file /home/lgts/workspace/rnaseq/Output/KG-1_DM4h-6_6.out/accepted_hits_sorted.bam.0000.bam.

thanks you for your answers

RNA-Seq samtools • 4.3k views
ADD COMMENT
0
Entering edit mode

In addition to the question of genomax, can you check your hard disk isn't full and the directory you are writing to does exist?

ADD REPLY
0
Entering edit mode

thank you for reply genomax and Wouterdecoster. I was checking my menory capacity and apparentely that's the problem. when I solve this, I tell them if I solved the problem.

thanks again

ADD REPLY
0
Entering edit mode

That does not sound correct. Memory should have no effect on your ability to write to a specific directory.

ADD REPLY
2
Entering edit mode
6.4 years ago

You are using samtools 0.1.18, which was released almost seven years ago.

If you use any of the last seven released versions of samtools, this error message will explain why it was unable to create this temporary file.

ADD COMMENT
0
Entering edit mode
6.4 years ago
GenoMax 147k

Is the directory /home/lgts/workspace/rnaseq/Output/KG-1_DM4h-6_6.out/ not writable from the account you are running samtools sort from?

ADD COMMENT
0
Entering edit mode
6.4 years ago

hi everybody,

I wanted to comment how finished my history with "samtools sort"

my mistake was, the syntax of the command

I used this command: $Samtools sort -n $Temp/$i.out/accepted_hits.bam -o $oDirectory/$i.out/accepted_hits_sorted.bam

and the correct command it's

samtools sort -n input.bam output.bam

Thanks to all for the help...

ADD COMMENT
1
Entering edit mode

As @John said above (he is the maintainer of samtools so he knows) you are likely using samtools v.0.1.18. Please upgrade ASAP. That is a version that is 7 years old at this time and should no longer be used (unless required as a dependency by some other tool).

ADD REPLY
1
Entering edit mode

It's not merely “likely using” — that error message with that exact wording does not exist past 0.1.18. And, for the record, since leaving Sanger I continue to have some interest in samtools but am not “the maintainer” of samtools.

If ancient samtools is still required by particular other tools, IMHO those other tools should be named, shamed, and fixed.

ADD REPLY
0
Entering edit mode

Thanks for clarifying that.

ADD REPLY

Login before adding your answer.

Traffic: 2154 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