Thank you for the tip. I tried it and get the BAM file. But now I need to get the index file of the bam. When I use
samtools index test.bam > test.bai I get an error like this
EOF marker is absent. invalid BAM binary header (this is not a BAM file) Invalid BAM header. Fail to index..
I have tried this command and it worked.
samtools view -b test.bam > output.bam
Changed -h to -b ...
Thank you.