9.2 Read mapping using bwa
Read mapping with bwa is peculiar in which it requires two steps: in the first, bwa produces the mapping using an internal format (called sai format) that is different from the BAM/SAM that you saw before. The sai files need then to be converted in SAM. Moreover, in case of paired end reads, you will need to process them separately then join the outputs. You will do both steps in one script. Let’s open a text file called, for example, bwamapping.sh, in which you can write the usual stuff:
#$ -S /bin/sh #$ -cwd #$ -q amd.q,large.q,intel.q #$ -l h_vmem=16G #$ -e bwa_mapping.e #$ -N bwa_mapping #$ -o bwa_mapping.o module load bwa/0.7.12