Question: SAM to BAM conversion ERRORS
0
gravatar for amra.dhabalia
8 months ago by
amra.dhabalia0 wrote:

I want to convert a SAM file to BAM file. I've used SAMtools in Linux command-line for this. I am encountering the following errors:

  1. COMMAND - samtools view -bS ERR035486.sam > ERR035486.bam ERROR - [samopen] no @SQ lines in the header. [sam_read1] missing header? Abort!

In response to the above error, I used the next command. 2. COMMAND - samtools view -bT reference.fa ERR035486.sam > ERR035486.bam ERROR - [sam_header_read2] 361 sequences loaded. [sam_read1] reference 'SN:CHR_HSCHR15_4_CTG8' is recognized as '*'. Parse error at line 1: invalid CIGAR character Aborted (core dumped)

What do these errors mean? And how to resolve them?

bwa alignment samtools bam • 431 views
ADD COMMENTlink modified 8 months ago by y.hoogstrate460 • written 8 months ago by amra.dhabalia0
1
gravatar for y.hoogstrate
8 months ago by
y.hoogstrate460
Netherlands
y.hoogstrate460 wrote:

SAM consists of 2 parts:

  • the header (describing which reference genome with corresponding sequences was used as reference and which aligner was used)
  • the body (alignment relative to the sequences in the header)

you seem to have a SAM file that only contains part 2: the body. I don't know where you got your sam file from, but if you are able to regenerate it from a BAM file, use -h to include the header.

samtools view -h original.bam > ERR....sam

edit: you also seem to get this error: Parse error at line 1: invalid CIGAR character Aborted (core dumped)

I think you need to open the first line(s) of your sam file in a text editor because this seems to be corrupt data?

ADD COMMENTlink modified 8 months ago • written 8 months ago by y.hoogstrate460
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 93 users visited in the last hour