Conversion of sam to bam using samtools
1
0
Entering edit mode
5.7 years ago

Hello,

The alignment with the whole human genome and my data, the sam files are genertaed but when I tried to use the samtools for conversion sam to bam facing problem of header. with the reference sequence also am not able to do it.

Any other way to do it?

output:

[sam_header_line_parse] expected '@XY', got [@A00306:15:H3WG3DMXX:1:1101:14705:1000 2:N:0:TAGCTTAT]
Hint: The header tags must be tab-separated.
[sam_header_read2] 0 sequences loaded.
[samopen] no @SQ lines in the header.
[main_samview] random alignment retrieval only works for indexed BAM files.
samtools RNA-Seq ngs sam bam • 10k views
ADD COMMENT
2
Entering edit mode

I've changed your post type to a question. Tools are for promoting new pieces of software etc, not for questions regarding tools.

ADD REPLY
0
Entering edit mode

Can you post the command you are using to convert sam to bam? Typical command would be: samtools view -S -bh sample.sam > sample.bam

ADD REPLY
1
Entering edit mode

to the above command suggested

 [samopen] no @SQ lines in the header.
 [sam_read1] missing header? Abort!
ADD REPLY
0
Entering edit mode
samtools view -bT ref.fastq test.sam >output.bam
ADD REPLY
1
Entering edit mode

Hello,

  • Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
    code_formatting

  • Also it isn't necessary to answer to each post with the same content. Everyone who already posted here is informed about new messages.

Thank you!

fin swimmer

ADD REPLY
0
Entering edit mode
5.7 years ago

Hello abhilashreddy495,

what was the exact command use for the alignment? Also please post the beginning of your sam file e.g. with head input.sam.

fin swimmer

ADD COMMENT
0
Entering edit mode
head '/media/abhilash/Abhilash/grch38/outputn.sam' 

�BC!sr�ed�|�t�
ADD REPLY
0
Entering edit mode

Your sam file is already a binary file.

What happens here?

samtools view -H outputn.sam

fin swimmer

ADD REPLY
0
Entering edit mode
[bam_header_read] EOF marker is absent. The input is probably truncated.
ADD REPLY
0
Entering edit mode

That's sounds like your file is broken or it isn't a bam/sam file. One last try:

$ samtools view outputn.sam|head

You haven't answer the question how your alignment file was created. For more help we need to know this.

fin swimmer

ADD REPLY
0
Entering edit mode

It sounds a little like its already converted to a BAM, but the headers haven't been preserved?

ADD REPLY
1
Entering edit mode

That was my intention ;)

ADD REPLY
0
Entering edit mode

The same error as above. by using hisat2

ADD REPLY
1
Entering edit mode

Exact command please.

But at all it looks like your data is corrupted and you have to start from the beginning.

ADD REPLY

Login before adding your answer.

Traffic: 2594 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6