samtools convert SAM to BAM error code
1
0
Entering edit mode
2.0 years ago
gbmygbm ▴ 10

Dear Community:

I'm trying to convert my SAM file (created by bwa mem) to BAM file. The SAM file could normally viewed and has correct headers. But when I tried to convert it to BAM file, the result would be error code. Could anybody help me to solve this problem?

My converting command is:

samtools view -bS /sample.sam > sample.bam

Looking forward to get your suggestion.

Thanks in advance

samtools bwa • 690 views
ADD COMMENT
1
Entering edit mode

What I don't understand is why you do not include the error code you got. This clearly will help us in helping you. In any case, Pierre gave you a clue about your problem. By using the "/" linux will try to find a local or global directory and not a file. Presumably your error code is that the file is not found. Omit the "/" if you are in the same directory than your file

ADD REPLY
0
Entering edit mode

your bam file is in the root directory ?

/sample.sam

did you mean

./sample.sam 

?

ADD REPLY
1
Entering edit mode
2.0 years ago
gbmygbm ▴ 10

Thank you very much. I forgot the BAM file is the binary coding mode of SAM and if Iopen it directly it would show the error code. Actually when I open it by samtools view sample.bam , it works normally. So it's just not a problem.

ADD COMMENT

Login before adding your answer.

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