-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall_dependency.sh
148 lines (136 loc) · 4.27 KB
/
install_dependency.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/bin/bash
usage() {
echo "Usage: $0 [-p/-path path of the project]
[-a/-annovar path of annovar]
[-i/-index choose between hg19 or hg38]
[-pr/-perm java]
[-jv/-java java]" 1>&2
}
exit_abnormal_code() {
echo "$1" 1>&2
exit $2
}
exit_abnormal_usage() {
echo "$1" 1>&2
usage
exit 1
}
exit_abnormal() {
usage
exit 1
}
while [ -n "$1" ]; do
case "$1" in
-path | -p)
path="$2"
echo "The value provided for path is $path"
shift
;;
-annovar | -a)
annovar="$2"
echo "The value provided for annovar path is $annovar"
shift
;;
-index | -i)
index="$2"
echo "The value provided for index is $index"
shift
;;
-java | -jv)
java="$2"
echo "The value provided for java is $java"
shift
;;
-perm | -pr)
perm="$2"
echo "The value provided for permission is $perm"
if ! { [ "$perm" = "yes" ] || [ "$perm" = "no" ]; }; then
exit_abnormal_usage "Error: permission must be equal to yes or no."
fi
shift
;;
*)
exit_abnormal_usage "Error: invalid parameter \"$1\"."
shift
;;
esac
shift
done
#!/bin/bash
PROJ_PATH=$path
PATH_PROGRAM=$PROJ_PATH/program
PATH_INDEX=$PROJ_PATH/index
PATH_JAVA=$jv
PATH_ANNOVAR=$annovar
mkdir $PATH_INDEX
mkdir $PATH_PROGRAM
if [ $perm == "yes" ]; then
sudo apt install -y samtools
sudo apt install -y bowtie2
sudo apt install -y cutadapt
sudo apt install -y fastqc
sudo apt install -y python3-pip
sudo apt install -y unzip
sudo pip3 install CrossMap
else
conda install -c bioconda samtools
conda install -c bioconda bowtie2
#conda install -c bioconda trim-galore
conda install -c bioconda fastqc
conda install -c conda-forge unzip
conda install -c bioconda crossmap
#installazioni conda - inserire nella guida da dove si installa anaconda e di installare un ambiente python3
fi
cd $PATH_PROGRAM
curl -fsSL https://github.com/FelixKrueger/TrimGalore/archive/0.6.6.tar.gz -o trim_galore.tar.gz
tar xvzf trim_galore.tar.gz
wget https://github.com/broadinstitute/picard/releases/download/2.26.2/picard.jar
wget https://github.com/broadinstitute/gatk/releases/download/4.1.0.0/gatk-4.1.0.0.zip
unzip gatk-4.1.0.0.zip
mv gatk-4.1.0.0/gatk-package-4.1.0.0-local.jar ./
wget https://github.com/dkoboldt/varscan/archive/refs/heads/master.zip
unzip master.zip
mv varscan-master/VarScan.v2.4.3.jar ./
cd
if [ $index == "hg19" ]; then
cd $PATH_INDEX
wget https://genome-idx.s3.amazonaws.com/bt/hg19.zip
unzip hg19.zip
mkdir hg19
mv hg19.* hg19/
wget http://hgdownload.cse.ucsc.edu/goldenpath/hg19/bigZips/hg19.fa.gz
gunzip hg19.fa.gz
samtools faidx hg19.fa
$PATH_JAVA -jar $PATH_PROGRAM/picard.jar CreateSequenceDictionary R=hg19.fa O=hg19.dict
cd $PATH_ANNOVAR/humandb
wget https://ftp.ncbi.nlm.nih.gov/snp/organisms/human_9606_b151_GRCh37p13/VCF/00-All.vcf.gz
wget https://ftp.ncbi.nlm.nih.gov/snp/organisms/human_9606_b151_GRCh37p13/VCF/00-All.vcf.gz.tbi
gunzip 00-All.vcf.gz
mv 00-All.vcf snp151_hg19.vcf
mv 00-All.vcf.gz.tbi snp151_hg19.vcf.gz.tbi
else
cd $PATH_INDEX
wget https://genome-idx.s3.amazonaws.com/bt/GRCh38_noalt_as.zip
unzip GRCh38_noalt_as.zip
mv GRCh38_noalt_as hg38
cd hg38
rename 's/^GRCh38_noalt_as\./hg38./' GRCh38_noalt_as.*
cd ..
wget https://www.encodeproject.org/files/GRCh38_no_alt_analysis_set_GCA_000001405.15/@@download/GRCh38_no_alt_analysis_set_GCA_000001405.15.fasta.gz
gunzip GRCh38_no_alt_analysis_set_GCA_000001405.15.fasta.gz
mv GRCh38_no_alt_analysis_set_GCA_000001405.15.fasta.gz hg38.fa
samtools faidx hg38.fa
$PATH_JAVA -jar $PATH_PROGRAM/picard.jar CreateSequenceDictionary R=hg38.fa O=hg38.dict
cd $PATH_ANNOVAR/humandb
wget https://ftp.ncbi.nlm.nih.gov/snp/organisms/human_9606_b151_GRCh38p7/VCF/00-All.vcf.gz
wget https://ftp.ncbi.nlm.nih.gov/snp/organisms/human_9606_b151_GRCh38p7/VCF/00-All.vcf.gz.tbi
gunzip 00-All.vcf.gz
mv 00-All.vcf snp151_hg38.vcf
mv 00-All.vcf.gz.tbi snp151_hg38.vcf.gz.tbi
cd ../..
fi
cd $PATH_ANNOVAR
perl annotate_variation.pl -downdb -webfrom annovar 1000g2015aug humandb -buildver $index
perl annotate_variation.pl -downdb -webfrom annovar refgene humandb -buildver $index
perl annotate_variation.pl -downdb -webfrom annovar esp6500siv2_all humandb -buildver $index
perl annotate_variation.pl -downdb -webfrom annovar cosmic70 humandb -buildver $index