Hi,
I'm trying to filter properly paired and mapped reads from a BWA alignment using this command:
But the terminal tells me:
Despite these error messages, the output file (test.bam) is generated and seems to contain the reads I selected.
I red that I should not take care of this error messages. However, how I can be sure that there are no problems or that my output file is not truncated ?
But there's a more annoying consequence: I cannot handle further my test.bam file, because samtools says the formatting is incorrect !
example, if I try:
I get again:
But if I open the file (using the -u option in the last pipe to avoid compression), I see that the header with @HD and @SQ is here ! So why do samtools not see it ?
Moreover, when I use "samtools view" to convert my .sam into .bam or to sort the previous .bam, everything works well (header is present and samtools can read the .bam file)... at least when I run these command in two steps not piping them.
I've read several threads on this issue, but I couldn't find a clear answer
(but I'm new to bioinformatics, so maybe I did'nt get it).
Please, could someone help me on this issue?
For info, I'm running samtools Version: 0.1.19-96b5f2294a.
Before, I ran BWA (Version: 0.7.5a-r405) for mapping
I'm trying to filter properly paired and mapped reads from a BWA alignment using this command:
Code:
samtools view -hu -F4 bam_sorted.[COLOR="Red"]b[/COLOR]am | samtools view -hu -F256 - | samtools view -h -f3 - > test.bam
Code:
[bam_header_read] EOF marker is absent. The input is probably truncated. [bam_header_read] EOF marker is absent. The input is probably truncated.
I red that I should not take care of this error messages. However, how I can be sure that there are no problems or that my output file is not truncated ?
But there's a more annoying consequence: I cannot handle further my test.bam file, because samtools says the formatting is incorrect !
example, if I try:
Code:
samtools view -c test.bam
Code:
[bam_header_read] EOF marker is absent. The input is probably truncated. [bam_header_read] invalid BAM binary header (this is not a BAM file). [main_samview] fail to read the header from "test.bam".
Moreover, when I use "samtools view" to convert my .sam into .bam or to sort the previous .bam, everything works well (header is present and samtools can read the .bam file)... at least when I run these command in two steps not piping them.
I've read several threads on this issue, but I couldn't find a clear answer
(but I'm new to bioinformatics, so maybe I did'nt get it).
Please, could someone help me on this issue?
For info, I'm running samtools Version: 0.1.19-96b5f2294a.
Before, I ran BWA (Version: 0.7.5a-r405) for mapping
Comment