-
Notifications
You must be signed in to change notification settings - Fork 1
/
standard.sh
36 lines (26 loc) · 967 Bytes
/
standard.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /bin/bash
type mpiBWA
if [[ ! $? -eq 0 ]]
then
echo "ERROR: mpiBWA not found in your PATH"
exit 1
fi
output_dir=${HOME}/mpiBWAExample
if [[ ! -d ${output_dir} ]]
then
mkdir -p ${output_dir}
echo "INFO: the directory ${output_dir} has been created to store the results generated by mpiBWAExample"
fi
if [[ ! -f ${output_dir}/hg19.small.fa ]]
then
echo "INFO: untar the (small) reference human genome with bwa index"
tar zxvf data/hg19.small.tar.gz --directory ${output_dir}
fi
if [[ ! -f ${output_dir}/hg19.small.fa.map ]]
then
echo "INFO: creating the binary image of the (small) reference genome with mpiBWAIdx"
mpiBWAIdx ${output_dir}/hg19.small.fa
fi
echo "INFO: aligning the reads with mpiBWA"
mpirun -n 2 mpiBWA mem -t 8 -o ${output_dir}/HCC1187C.sam ${output_dir}/hg19.small.fa data/HCC1187C_R1_10K.fastq data/HCC1187C_R2_10K.fastq 2> ${output_dir}/mpiBWA.log
echo "INFO: mpiBWA.log is available in ${output_dir}"