forked from sustc-xylab/ARGpore2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
124 lines (98 loc) · 4.22 KB
/
setup.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
#!/bin/bash
set -e
SCRIPT=`realpath $0`
DIR=`dirname $SCRIPT`
cd ${DIR}/bin
########## seqkit
echo "Installing seqkit ---------------------------------------------------------------------
"
wget https://github.com/shenwei356/seqkit/releases/download/v0.12.1/seqkit_linux_amd64.tar.gz --output-document 'seqkit_linux_amd64.tar.gz'
tar -zxvf seqkit_linux_amd64.tar.gz
rm seqkit_linux_amd64.tar.gz
############ blast+ 2.9.0
echo ""
echo "Installing blast+2.9.0 ---------------------------------------------------------------------
"
curl https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.11.0/ncbi-blast-2.11.0+-x64-linux.tar.gz --output ncbi-blast-2.11.0+-x64-linux.tar.gz
tar -zvxf ncbi-blast-2.11.0+-x64-linux.tar.gz
rm -f ncbi-blast-2.11.0+-x64-linux.tar.gz
rm -rf ncbi-blast+
mv ncbi-blast-2.11.0+ ncbi-blast+
########## Centrifuge
echo ""
echo "Intalling Centrifuge -------------------------------------------------------------------
"
wget ftp://ftp.ccb.jhu.edu/pub/infphilo/centrifuge/downloads/centrifuge-1.0.3-beta-Linux_x86_64.zip --output-document 'centrifuge-1.0.3-beta-Linux_x86_64.zip'
unzip centrifuge-1.0.3-beta-Linux_x86_64.zip
rm centrifuge-1.0.3-beta-Linux_x86_64.zip
rm -rf centrifuge
mv centrifuge-1.0.3-beta centrifuge
############# ccontigs #####
# echo "
# Installing ccontigs ---------------------------------------------------------------------
# "
# if [ -d ccontigs ]; then
# rm -rf ccontigs
# fi
# git clone https://github.com/Microbiology/ccontigs.git
# curl https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.2-linux-x86_64.tar.gz --output julia-1.4.2-linux-x86_64.tar.gz
# tar -xvzf julia-1.4.2-linux-x86_64.tar.gz
# rm -f julia-1.4.2-linux-x86_64.tar.gz
echo "Finish install required tools
------------------------------------------------------------------"
cd ${DIR}/database
# MetaPhlan2.0 markergene database ##############################
echo "
Downloading Metaphlan2 markergene database from git lfs"
git lfs install
git lfs pull
tar jxvf markers.fasta.tar.xz
echo "
Building lastdb for Metaphlan2 markergene database"
${DIR}/bin/last-983/src/lastdb -Q 0 markers.lastindex markers.fasta -P 10
$DIR/bin/fastaNameLengh.pl markers.fasta > markers.fasta.length
rm -f markers.fasta.tar.xz
###### SARG-nt database ################
echo "
Building lastdb for SARG-nt database"
tar zxvf SARG_20211207_14210_filter.ffn.tar.gz
${DIR}/bin/last-983/src/lastdb -Q 0 SARG_20211207_14210_filter.ffn SARG_20211207_14210_filter.ffn -P 10
$DIR/bin/fastaNameLengh.pl SARG_20211207_14210_filter.ffn > SARG_20211207_14210_filter.ffn.length
rm -f SARG_20211207_14210_filter.ffn.tar.gz
########### ESCG database ##########################################
echo "
Building lastdb for ESCG database"
tar jxvf ESCG.fna.tar.xz
${DIR}/bin/last-983/src/lastdb -Q 0 ESCG.fna ESCG.fna -P 10
$DIR/bin/fastaNameLengh.pl ESCG.fna > ESCG.fna.length
rm -f ESCG.fna.tar.xz
########### lineage database ###################################################################
echo "
Downloading lineage information for NCBI taxonomy"
tar jxvf 2020-06-16_lineage.tab.tar.xz
mv database/2020-06-16_lineage.tab .
rm -rf database
######### PLSDB database #################################
echo "
Downloading PLSDB"
wget https://ndownloader.figshare.com/files/21961095 --output-document 'PLSDB.zip'
unzip PLSDB.zip
mv data/pls/PLSDB_2020_03_04 .
$DIR/bin/ncbi-blast+/bin/blastdbcmd -db PLSDB_2020_03_04/plsdb.fna -dbtype nucl -entry all -outfmt "%f" -out PLSDB_2020_03_04.fna
grep ">" PLSDB_2020_03_04.fna | sed 's/>//' | sed 's/\ /\t/' > PLSDB_2020_03_04.fna.name
$DIR/bin/fastaNameLengh.pl PLSDB_2020_03_04.fna > PLSDB_2020_03_04.fna.length
rm -rf data
rm PLSDB.zip
# make last database using PLSDB database
echo "
Building lastdb for PLSDB, this step is quite slow, please stay patient :)"
${DIR}/bin/last-983/src/lastdb -Q 0 PLSDB_2020_03_04.fna.lastindex PLSDB_2020_03_04.fna -P 50
######### centrifuge database #################################
echo "
Downloading Centrifuge database"
wget https://genome-idx.s3.amazonaws.com/centrifuge/p_compressed%2Bh%2Bv.tar.gz --output-document 'p+b+v.tar.gz'
tar -zvxf p+b+v.tar.gz
rm p+b+v.tar.gz
echo "Finish Download required databases
------------------------------------------------------------------"
echo "Done ARGpore2 setup"