This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Unable to convert from sam to bam file.
samtools view -S -b BD143_TGACCA_L005.sam -o BD143_TGACCA_L005.bam

When I am running this command the following error is appearing:

[main_samview] fail to read the header from "BD143_TGACCA_L005.sam"

As a result, if anyone knows how to fix this error and thanks.

bam sam samtools

Which aligner did you use to generate the SAM file? All aligners should write a valid header when the originally create that file.

BWA Aligner.

Well, what does the header look like?

An empty file.

What do you get when you try

head -3 BD143_TGACCA_L005.sam

If you have an empty file they your alignment did not work. You will need to debug your bwa step.

Thanks I have did it and it works.

You might be using the samtools new version which has changed the input parameters. Which samtools version are you using?

0 answers

No answers yet.

Log in to answer this question.