samtools(1) view -bt ref_seq.fa -o my_sample.bam my_sample.sam
Utilities for the Sequence Alignment/Map (SAM) format
-b      Output in the BAM format.
-t FLOAT  Scaled muttion rate for variant calling [0.001]
-o FILE Output file [stdout]
source manpages: samtools