BAM format is the binary version of a SAM file. The conversion can be performed using samtools:
samtools view -S -b my.sam > my.bam
BAM sorting
samtools sort my.bam > my-sorted.bam
BCFTOOLS to create VCF file
bcftools mpileup –fasta-ref reference_chr10_chr18.fa sorted.bam > sorted.vcf
Perform alignment
mkdir path_to_folder_where_BWA_index_will_be_created
bwa index -p path_to_folder_where_BWA_index_will_be_created path_to_reference_sequence/reference_chr10_chr18.fa
bwa mem path_to_folder_where_BWA_index_has_been_created path_to_reads_file/mate_1.fq path_to_reads_file/mate_2.fq > path_to_place_results/results.sam