# Align the reads to reference genome chromosome
bwa mem one_chromosome.fasta SRRXXXXXXX_1_paired.fastq SRRXXXXXXX_2_paired.fastq > SRRXXXXXXX.sam
Aligning reads requires a great amount of computational power and resources. If the process crash, sam files with broken ends can be generated. If this happens follow the steps below before continuing.
# To remove sam files with broke ends (this command removes the last line)
sed "$(($(wc -l < SRRXXXXXXX.sam))),\$d" SRRXXXXXXX.sam > SRRXXXXXXX.samm
# To rename the original broken files
mv SRRXXXXXXX.sam original_SRRXXXXXXX.sam
# To rename the not broken files
mv SRRXXXXXXX.samm SRRXXXXXXX.sam