Converting .sam to .bam with samtools and I get a new error with every repeated command
Entering edit mode
6.8 years ago

I am using the samtools view -b -S -o command and I seem to get a new error every time I run the command.

I will get [sam_read1] reference 'AMELIA:269' is recognized as '*'. [main_samview] truncated file.


Parse error at line 5177839: sequence and quality are inconsistent Aborted (core dumped) this line changes everytime

Also [sam_read1] reference 'AMELIA:269:C1EUFACXX:2:1101:12' is recognized as '*'. [main_samview] truncated file.'

The sam input file was created with the bwa sampe command

Assembly alignment SNP • 2.1k views
Entering edit mode

you sure, you used the right reference when generating sam file? Most likely your sam header is messed up, also:

Error In Converting Sam To Bam By Samtools

it could be that your alignment was not finished prior to generating sam file maybe it's a good idea to wrap your mapping in a shell script, and echo when each stage was finished

Entering edit mode
6.8 years ago

I had what appears to be a similar problem when using nohup and some other ways to redirect the bwa output and its' progress information that it prints out a couple of years ago. The reason is that it bwa is not interacting properly with standard methods and for a strange reason sometimes prints its progress information into the output alignment file making the later corrupted.

Could you please grep the sam output file with -A 2 -B2 option for "AMELIA", "sam_read1", "main_samview" and other phrases you get in the error massages and print out grep results here?

If you have same problems as I had than the first thing to test is to start your bwa as recommended in the documentation and then use control+Z and bg and disown. See if the result is going to be corrupted still.

Thank you.


Login before adding your answer.

Traffic: 995 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6