Hello, I have some SAM files which lack the header. In order to convert them to BAM I need first to add the header, but unfortunately I do not have any header file. Recently, Istvan Albert suggested (see here How to extract unaligned sequences from BAM files obtainend from BWA and here C: Obtaining the consensus sequence from a BAM file in FASTA) to use the Samtools's view option which the -h flag, but I get:
$ samtools view -S -h my_FILE.bam [samopen] no @SQ lines in the header. [sam_read1] missing header? Abort!
Maybe I am using the wrong syntax, I got the same error before (again, see here C: Obtaining the consensus sequence from a BAM file in FASTA). I tried also to use Picard Tools, but when I look at ReplaceSamHeader's manual I see that an input for the header is strictly required.
In brief, is it possible to generate a SAM header without any external header information?