Samtools

  1. Convert SAM to BAM:

samtools view -bS Mapped_and_unmapped_Solanaceae.sam > S28_mapped_and_unmapped.bam
  1. Sort BAM file:

samtools sort S28_mapped_and_unmapped.bam -o S28_sorted.bam
  1. Create BAM index:

samtools index S28_sorted.bam S28_sorted.bai