I ran the following the command to extract bam file for specific chromosomal locus.
samtools view -h accepted_hits.bam "EQ963475:334376-335722">AFLA_105440.bam
The result of command was generated with header file<h6>first few lines output file</h6>
@HD VN:1.0 SO:coordinate @SQ SN:EQ963472 LN:4469204 @SQ SN:EQ963473 LN:4149026 @SQ SN:EQ963474 LN:2713190 @SQ SN:EQ963475 LN:2658400 @SQ SN:EQ963476 LN:2555871 @SQ SN:EQ963477 LN:2388123 @SQ SN:EQ963478 LN:2337902
When I ran the below command for conversion of bam to fastq
samtools bam2fq AFLA_105440.bam >AFLA_105440.fq
it showing error like this: [bam_header_read] EOF marker is absent. The input is probably truncated. [bam_header_read] invalid BAM binary header (this is not a BAM file).