I got your file..
Your bam file is right. It contains the header. I see you used bowtie2 with samtools view -H SRR733103.bam
with samtools view SRR733103.bam | cut -f3 | uniq -c
I can see that you have 3777516 mapped reads to the reference sequence named NC_006088.4 (is not chr1, you need to use the actual name you used for the reference sequence)
Then you need to index your BAM with samtools index SRR733103.bam
Once you have your BAM file indexed you can run samtools view -h NC_006088.4:67246039-67350164 > selected.sam
In selected.sam you have all the mapped sequences to NC_006088 included in the range of the indicated coordinates, and will include the header into the new sam file. You don't actually need to use a bam file for that as selected.sam file is small
Hope this helps
Do you want to align only 1 chr1 sequence to the reference genome? Is that your question ?
yes, infact, I have a specific location to align that is associated with my trait of interest e.g. 1:67,246,039- 67,350,164. And I have raw mate pair fastq files.
I have created a bam file using bowtie2. Ref file is chr1 of the reference genome. with 2 mate pair fastq files.
here is the same result:
But i cannot extract the coordinates as you suggested: Antonio R. Franco
I dont understand, what to do at this point
You are doing right in reding these instructions http://www.htslib.org/doc/samtools.html. samttools view had some requirements, like the presence of the header. If you want, share your bam file with me through dropbox, mega or the like, and I give it a look. My address is arfranco (@) uco.es