-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.sh
66 lines (52 loc) · 2.19 KB
/
index.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
set -euo pipefail
# construct config file for ScanIndel
HLAs=(A B C DPA1 DPB1 DQA1 DQB1 DRB1)
dir=$(cd `dirname $0`; pwd)
# :<<!
for hla in ${HLAs[@]}; do
config_file=$dir/db/HLA/HLA_${hla}.config.txt
echo bwa=$dir/db/HLA/HLA_${hla}/HLA_${hla}.fa >$config_file
echo freebayes=$dir/db/HLA/HLA_${hla}/HLA_${hla}.fa >>$config_file
echo blat=$dir/db/HLA/HLA_${hla}/ >>$config_file
done
license=$dir/bin/novoalign.lic
if [ -f "$license" ];then
# index the database for novoalign
echo "Find License for Novoalign."
if [ -f "$dir/db/ref/hla_gen.format.filter.extend.DRB.no26789.ndx" ] && [ -f "$dir/db/ref/hla_gen.format.filter.extend.DRB.no26789.v2.ndx" ];then
echo "Find reference index for Novoalign."
else
echo "Index the reference for novoalign..."
$dir/bin/novoindex -k 14 -s 1 $dir/db/ref/hla_gen.format.filter.extend.DRB.no26789.ndx \
$dir/db/ref/hla_gen.format.filter.extend.DRB.no26789.fasta
$dir/bin/novoindex -k 14 -s 1 $dir/db/ref/hla_gen.format.filter.extend.DRB.no26789.v2.ndx \
$dir/db/ref/hla_gen.format.filter.extend.DRB.no26789.v2.fasta
fi
else
# index the database for bowtie2
echo "Cannot Find License for Novoalign, index the reference for bowtie2."
bowtie2-build $dir/db/ref/hla_gen.format.filter.extend.DRB.no26789.fasta $dir/db/ref/hla_gen.format.filter.extend.DRB.no26789.fasta
bowtie2-build $dir/db/ref/hla_gen.format.filter.extend.DRB.no26789.v2.fasta $dir/db/ref/hla_gen.format.filter.extend.DRB.no26789.v2.fasta
fi
# the lib required by samtools
ln --force -s $dir/spechla_env/lib/libncurses.so.6 $dir/spechla_env/lib/libncurses.so.5
ln --force -s $dir/spechla_env/lib/libtinfo.so.6 $dir/spechla_env/lib/libtinfo.so.5
#ln -s $dir/spechla_env/lib/libhts.so.3 $dir/spechla_env/lib/libhts.so.2
# !
# install spechap
mkdir -p $dir/bin/SpecHap/build
cd $dir/bin/SpecHap/build
cmake .. -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
make
# install spechap
mkdir -p $dir/bin/extractHairs/build
cd $dir/bin/extractHairs/build
cmake .. -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
make
cd $dir
echo " "
echo " "
echo " "
echo The installation is finished! Please start use SpecHLA.
echo "-------------------------------------"