-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·46 lines (31 loc) · 1.39 KB
/
install.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
#!/bin/bash
# This script will install ANNOVAR with the required databases
# http://annovar.openbioinformatics.org/en/latest/user-guide/download/
bin_dir="${1:-$HOME/annovar}" # default to home dir
db_dir="${2:-$bin_dir/db}"
printf "Bin dir:\n%s\n\n" "$bin_dir"
printf "Databse dir:\n%s\n\n" "$db_dir"
install () {
local bin_dir="$bin_dir"
local db_dir="$db_dir"
mkdir -p "$bin_dir" && mkdir -p "$db_dir" && (
cd "$bin_dir"
# download ANNOVAR and extract
if [ ! -f annovar.latest.tar.gz ]; then
wget http://www.openbioinformatics.org/annovar/download/0wgxR2rIVP/annovar.latest.tar.gz
tar -zxvf annovar.latest.tar.gz
fi
# install ANNOVAR db's
# hg19
hg19_db_dir="${db_dir}/hg19/"
mkdir -p "$hg19_db_dir"
"${bin_dir}/annovar/annotate_variation.pl" -downdb -buildver hg19 -webfrom annovar refGene "$hg19_db_dir"
"${bin_dir}/annovar/annotate_variation.pl" -buildver hg19 -downdb cytoBand "$hg19_db_dir"
# mm10
mm10_db_dir="${db_dir}/mm10/"
mkdir -p "$mm10_db_dir"
"${bin_dir}/annovar/annotate_variation.pl" -downdb -buildver mm10 -webfrom annovar refGene "$mm10_db_dir"
"${bin_dir}/annovar/annotate_variation.pl" -buildver mm10 -downdb cytoBand "$mm10_db_dir"
) || printf "ERROR: Could not make directory for installation:\n%s\n\nExiting..." "$bin_dir" "$db_dir" && exit 1
}
install "$bin_dir" "$db_dir"