The answers in old post were perfect explanation for this problem. Even more you have not provided much details on whether this BAM is downloaded or created on your own. Did you check all the chromosomes are present in BAM (if the data is not for any single chromosome) ?
The explanation was brief, the file is broken, or truncated. It might have been downloaded incompletely or the process terminated prematurely. To be sure try to read the whole file with samtools view. If that does complain too, the file is broken, if not it was this specific command (bam2fastq). If the file is broken, try to download it again and use a tool like wget or curl, and try to get a checksum for the download.
If created yourself, check the output, maybe samtools was killed. One of the most common reasons we see for truncated files is simply 'disk full'.
Congrats Muthu -- and you did it a better way than the way I suggested :)
However, the error you had in the first place was so obvious I think a lot of people overlooked it. How could someone not know their data is a 100Gb SAM file instead of a 1Gb BAM file? How could someone not know that their data is human-readable text and not garbled binary? No one is going to appreciate me saying this, so trust me when I say i only mention it for your sake -- but if you continue to run tools without doing any sort of checks that the tools work or gave you the output you expected, you're going to run into a lot of these silly little issues that will either slow you down - or worse - give you reasonable-looking result that are totally incorrect. Use head and tail, check filesizes, etc etc. Don't rely on the tools, as in the example above, to do everything for you :)
Possible reasons - Eof Marker Is Absent When Processing A Bam File
Hello muthubioinfotech!
Questions similar to yours can already be found at:
We have closed your question to allow us to keep similar content in the same thread.
If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.
Cheers!
And it's cross posted see here
see that old post it didn't have any proper or appropriate explanation
The answers in old post were perfect explanation for this problem. Even more you have not provided much details on whether this BAM is downloaded or created on your own. Did you check all the chromosomes are present in BAM (if the data is not for any single chromosome) ?
The explanation was brief, the file is broken, or truncated. It might have been downloaded incompletely or the process terminated prematurely. To be sure try to read the whole file with samtools view. If that does complain too, the file is broken, if not it was this specific command (bam2fastq). If the file is broken, try to download it again and use a tool like wget or curl, and try to get a checksum for the download. If created yourself, check the output, maybe samtools was killed. One of the most common reasons we see for truncated files is simply 'disk full'.
Thanks for reply .I am sorry still I could not able to understand what were mention there.