head '/media/abhilash/Abhilash/grch38/outputn.sam'
�BC!sr�ed�|�t�
Conversion of sam to bam using samtools
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.
• 12,583 views
•
link
1 answer
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
• 0 views
•
link
• 0 views
•
link
Your sam file is already a binary file.
What happens here?
samtools view -H outputn.sam
fin swimmer
• 0 views
•
link
[bam_header_read] EOF marker is absent. The input is probably truncated.
• 0 views
•
link
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
• 0 views
•
link
Log in to answer this question.
Can you post the command you are using to convert sam to bam? Typical command would be:
samtools view -S -bh sample.sam > sample.bamHello,
Please use the formatting bar (especially the

codeoption) to present your post better. I've done it for you this time.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
to the above command suggested
I've changed your post type to a question. Tools are for promoting new pieces of software etc, not for questions regarding tools.
samtools view -bT ref.fastq test.sam >output.bam