This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Truncated File, When Converting Sam To Bam

Dear BioStarers,

When I convert my sam file to bam file, I got "truncated file" in prompt, and also "[sam_read1] reference '503821040998320619' is recognized as '*'". It is no such problem, when I converted other sam files to bam using the same reference, here is "../Alyrref.folded.fa.fai". Now, I do not know what I can do next.

So, I need to get helps from you. What have happened? Is it a serious problem? Can I still use this truncated file for pileup? Thanks in advance.

My command and the prompt:

$ samtools view -bht ../Alyrref.folded.fa.fai map.list.sam > map.list.bam
[sam_header_read2] 1099 sequences loaded.
[sam_read1] reference '503821040998320619' is ecognized as '*'.
[main_samview] truncated file.
sam bam conversion

I suggest you edit your question and include the last few lines of your SAM file - it sounds like the last line in the file is truncated, but maybe something else is going on. Use the tail command to get the final lines, e.g. "tail -3 map.list.sam".

1 answer

I remember that I had a similar problem a while ago. In my case it was because the sam file was faulty: bwa was terminated because the qsub time allocation was just too short for the massive amount of data that came from this particular lane (cluster density was way too high). Running your mapping program again to get an intact sam file might solve this problem.

Log in to answer this question.