How about if you don't have the reference?
Soap2Sam.Pl No Headers In Sam File
When I convert a SOAP Paired end output to a SAM file using the soap2sam.pl script(http://soap.genomics.org.cn/down/soap2sam.tar.gz) my SAM file headers turn out to be empyty.
Is there a way I can add headers to the SAM file ?
• 6,174 views
•
link
1 answer
You can add the headers using samtools view:
samtools view -bT your_reference.fasta your_input.sam > your_input.bam
Use samtools view -H your_input.bam to check whether the header was added.
• 2 views
•
link
• 0 views
•
link
See older question here: Is It Possible To Generate A Sam Header Without Any External Header Information?
I guess technically, it's possible - you would have to parse out all present chromosomes from your SAM file, and the 'last' alignment that appears for each, and use that as the length.. But I don't think there's any script for that...
• 1 views
•
link
Log in to answer this question.