Prévia do material em texto
29/12/2021 09:06 introduction_to_microbiomics/setup_vm.sh at main · jmartinsjrbr/introduction_to_microbiomics https://github.com/jmartinsjrbr/introduction_to_microbiomics/blob/main/setup_vm.sh 1/6 jmartinsjrbr / introduction_to_microbiomics Public Code Issues Pull requests Actions Projects Wiki Security Insights introduction_to_microbiomics / setup_vm.sh jmartinsjrbr Update setup_vm.sh 1 contributor main 290 lines (240 sloc) 8.62 KB 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 #!/bin/bash ###THIS SCRIPT IS FOR INSTALLING THE NECESSARY PROGRAMS FOR OMICS COURSE ### #@Author: Joaquim Martins Junior ### #@Last update: 16-11-2021 ### ###OS UBUNTU 20.04 LTS 64bits### echo "**** UPDATING SYSTEM ****" sudo apt update && sudo apt list --upgradable && sudo apt upgrade sudo apt install python3-pip git byobu tmux vim curl libcurl4-openssl-dev libxml2 libxm sudo apt install openjdk-11-jdk openjdk-11-jdk-headless openjdk-11-jre-headless #Install R echo "**** INSTALLING R ****" sudo apt install r-base r-base-core r-base-dev #Set environmental vars echo "**** SETTING ENV VARS ****" test -d $HOME/omics_course || mkdir $HOME/omics_course test -d $HOME/bin || mkdir $HOME/bin test -d $HOME/omics_course/progs || mkdir $HOME/omics_course/progs test -d $HOME/omics_course/db || mkdir $HOME/omics_course/db ##add env vars to .bashrc echo "**** ADD PATHS TO ~/.bashrc ****" echo "#####BIOINFORMATICS ENV VARIABLES#####" >> $HOME/.bashrc echo "HOME_BIN=\$HOME/bin" >> $HOME/.bashrc echo "PATH=\$HOME_BIN:\$PATH" >> $HOME/.bashrc echo "export PATH" >> $HOME/.bashrc source ~/.bashrc https://github.com/jmartinsjrbr https://github.com/jmartinsjrbr/introduction_to_microbiomics https://github.com/jmartinsjrbr/introduction_to_microbiomics https://github.com/jmartinsjrbr/introduction_to_microbiomics/issues https://github.com/jmartinsjrbr/introduction_to_microbiomics/pulls https://github.com/jmartinsjrbr/introduction_to_microbiomics/actions https://github.com/jmartinsjrbr/introduction_to_microbiomics/projects?type=beta https://github.com/jmartinsjrbr/introduction_to_microbiomics/wiki https://github.com/jmartinsjrbr/introduction_to_microbiomics/security https://github.com/jmartinsjrbr/introduction_to_microbiomics/pulse https://github.com/jmartinsjrbr/introduction_to_microbiomics https://github.com/jmartinsjrbr https://github.com/jmartinsjrbr https://github.com/jmartinsjrbr/introduction_to_microbiomics/commit/4ae92cd40b3a95a386bf97e10a828e2eb9060038 https://github.com/jmartinsjrbr/introduction_to_microbiomics/commits/main/setup_vm.sh 29/12/2021 09:06 introduction_to_microbiomics/setup_vm.sh at main · jmartinsjrbr/introduction_to_microbiomics https://github.com/jmartinsjrbr/introduction_to_microbiomics/blob/main/setup_vm.sh 2/6 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 echo "$PATH" echo "$HOME_BIN" ###Intall Anaconda3 version 4.10.3 echo "**** INSTALLING ANACONDA3 ****" ##Dependencies: sudo apt install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 ##download anaconda cd ~/Downloads wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh chmod u+x Anaconda3-2021.05-Linux-x86_64.sh ./Anaconda3-2021.05-Linux-x86_64.sh source $HOME/omics_course/anaconda3/bin/activate conda init source ~/.bashrc conda config --set auto_activate_base False conda deactivate ###Create new anaconda environment "omics_course" echo "**** CREATING OMICS_COURSE ENV ****" conda update -n base -c defaults conda conda create -n omics_course python=3.8.10 eval "$(conda shell.bash hook)" conda activate omics_course ##install multiqc echo "**** INSTALLING MULTIQC ****" conda install -c bioconda -c conda-forge multiqc ##install fastp echo "**** INSTALLING FASTP ****" cd ~/Downloads wget http://opengene.org/fastp/fastp mv ./fastp ~/bin chmod a+x ~/bin/fastp ##install sortmerna echo "**** INSTALLING SORTMERNA ****" conda config --add channels bioconda conda install sortmerna ##set sortmerna databases SORTMERNADB=$HOME/omics_course/db/sortmerna test -d $SORTMERNADB || mkdir $SORTMERNADB while true; do read -p "Do you want to install sortmerrna databases [Yes/No]?" yn 29/12/2021 09:06 introduction_to_microbiomics/setup_vm.sh at main · jmartinsjrbr/introduction_to_microbiomics https://github.com/jmartinsjrbr/introduction_to_microbiomics/blob/main/setup_vm.sh 3/6 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 case $yn in [Yy]* ) echo "*****INSTALLING sortmerrna DB" cd $SORTMERNADB wget https://github.com/biocore/sortmerna/releases/download/v4 tar -xvf *.tar.gz rm *.gz cd; break;; [Nn]* ) break;; esac done ##Install o kaiju echo "**** INSTALLING KAIJU ****" git clone https://github.com/bioinformatics-centre/kaiju.git cd kaiju/src make cd ../../ mv kaiju* $HOME/omics_course/progs echo -e "\n##KAIJU SETUP" >> ~/.bashrc echo "export PATH=\$HOME/omics_course/progs/kaiju/bin/:\$PATH" >> ~/.bashrc ##set kaiju databases (nr_euk) KAIJUDB=$HOME/omics_course/db/kaiju test -d $KAIJUDB || mkdir $KAIJUDB SELECTED_DB='nr_euk' while true; do read -p "Do you want to install KAIJU nr_euk databases [Yes/No]?" yn case $yn in [Yy]* ) echo "*****INSTALLING KAIJU (nr_euk) DB" cd $KAIJUDB kaiju-makedb -s $SELECTED_DB cd; break;; [Nn]* ) break;; esac done ##Install KronaTools echo "**** INSTALLING KRONATOOLS ****" cd ~/Downloads wget https://github.com/marbl/Krona/releases/download/v2.8/KronaTools-2.8.tar mkdir $HOME/omics_course/progs/KronaTools-2.8 tar -xvf KronaTools-2.8.tar rm -rf KronaTools-2.8.tar mv KronaTools-2.8 $HOME/omics_course/progs/ cd $HOME/omics_course/progs/KronaTools-2.8 chmod u+x ./install.pl sudo ./install.pl 29/12/2021 09:06 introduction_to_microbiomics/setup_vm.sh at main · jmartinsjrbr/introduction_to_microbiomics https://github.com/jmartinsjrbr/introduction_to_microbiomics/blob/main/setup_vm.sh 4/6 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 ##install spades echo "**** INSTALLING SPADES ****" conda install -c bioconda spades ##Install kallisto echo "**** INSTALLING KALLISTO ****" conda install -c bioconda kallisto conda deactivate #Install prokka echo "**** INSTALLING PROKKA ****" conda create -n prokka -c conda-forge -c bioconda -c defaults prokka #Install run_dbcan echo "**** INSTALLING DBCAN ****" conda create -n run_dbcan python=3.8 diamond hmmer prodigal -c conda-forge -c bioconda conda activate run_dbcan pip3 install run-dbcan==2.0.11 cd $HOME/omics_course/db test -d dbcan || mkdir $HOME/omics_course/db/dbcan cd $HOME/omics_course/db/dbcan wget https://bcb.unl.edu/dbCAN2/download/CAZyDB.09242021.fa && diamond makedb --in CAZy wget https://bcb.unl.edu/dbCAN2/download/dbCAN-HMMdb-V10.txt && mv dbCAN-HMMdb-V10.txt wget http://bcb.unl.edu/dbCAN2/download/Databases/tcdb.fa && diamond makedb --in tcdb.f wget http://bcb.unl.edu/dbCAN2/download/Databases/tf-1.hmm && hmmpress tf-1.hmm wget http://bcb.unl.edu/dbCAN2/download/Databases/tf-2.hmm && hmmpress tf-2.hmm wget http://bcb.unl.edu/dbCAN2/download/Databases/stp.hmm && hmmpress stp.hmm conda deactivate ##install metawrap echo "**** INSTALLING METAWRAP ****" #download metawrap cd $HOME/omics_course test -d progs ||mkdir $HOME/omics_course/progs cd $HOME/omics_course/progs git clone https://github.com/bxlab/metaWRAP.git echo -e "\n##METAWRAPSETUP" >> ~/.bashrc echo "export PATH=\$HOME/omics_course/progs/metaWRAP/bin/:\$PATH" >> ~/.bashrc #Create metawrap env conda create -y -n metawrap-env python=2.7 conda activate metawrap-env #install dependencies conda config --add channels defaults conda config --add channels conda-forge conda config --add channels bioconda conda config --add channels ursky conda install --only-deps -c ursky metawrap-mg #Set quast databases 29/12/2021 09:06 introduction_to_microbiomics/setup_vm.sh at main · jmartinsjrbr/introduction_to_microbiomics https://github.com/jmartinsjrbr/introduction_to_microbiomics/blob/main/setup_vm.sh 5/6 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 quast-download-gridss quast-download-silva quast-download-busco ktUpdateTaxonomy.sh ###Manually download buscodb in case failing in previous attempt BUSCODBDIR=/home/bioinfo/omics_course/anaconda3/envs/metawrap-env/lib/python2.7/site-pa while true; do read -p "Do you want to install BUSCO DB for metawrap (Quast) manually [Yes/No] case $yn in [Yy]* ) echo "*****INSTALLING BUSCO DBs (Quast) manually" cd $BUSCODBDIR echo "*****Downloading bacteria db..." wget https://busco.ezlab.org/v2/datasets/bacteria_odb9.tar.gz tar -vzxf *.tar.gz echo "*****Downloading eukaryota db..." wget https://busco.ezlab.org/v2/datasets/eukaryota_odb9.tar.gz tar -vzxf eukaryota_odb9.tar.gz echo "*****Downloading fungi db..." wget https://busco.ezlab.org/v2/datasets/fungi_odb9.tar.gz tar -vzxf fungi_odb9.tar.gz cd; break;; [Nn]* ) break;; esac done cd ####### INSTALL METAWRAP DATABASES ##### METAWRAP_MAIN_DBDIR=$HOME/omics_course/db/metawrap CHECKM_FOLDER=$METAWRAP_MAIN_DBDIR/checkm KRAKEN2DB=$METAWRAP_MAIN_DBDIR/kraken2 NCBI_NT=$METAWRAP_MAIN_DBDIR/ncbi/nt NCBI_tax=$METAWRAP_MAIN_DBDIR/ncbi/taxonomy BMTAGGER=$METAWRAP_MAIN_DBDIR/bmtagger test -d $METAWRAP_MAIN_DBDIR || mkdir $METAWRAP_MAIN_DBDIR test -d $CHECKM_FOLDER || mkdir $CHECKM_FOLDER test -d $KRAKEN2DB || mkdir $KRAKEN2DB test -d $NCBI_NT || mkdir -p $NCBI_NT test -d $BMTAGGER || mkdir $BMTAGGER test -d $NCBI_tax || mkdir -p $NCBI_tax while true; 29/12/2021 09:06 introduction_to_microbiomics/setup_vm.sh at main · jmartinsjrbr/introduction_to_microbiomics https://github.com/jmartinsjrbr/introduction_to_microbiomics/blob/main/setup_vm.sh 6/6 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 do read -p "Do you want to install metaWRAP databases [Yes/No]?" yn case $yn in [Yy]* ) echo "*****INSTALLING CHECKM DB" cd $CHECKM_FOLDER wget https://data.ace.uq.edu.au/public/CheckM_databases/checkm_ tar -xvf *.tar.gz rm *.gz cd ../ echo "*****INSTALLING KRAKEN2 DB" cd $KRAKEN2DB kraken2-build --standard --threads 10 --db $KRAKEN2DB echo "Do not forget to set the KRAKEN_DB variable in the config cd ../ echo "*****INSTALLING NCBI_nt BLAST databases" cd $NCBI_NT wget "ftp://ftp.ncbi.nlm.nih.gov/blast/db/nt.*.tar.gz" for a in nt.*.tar.gz; do tar xzf $a; done echo "Do not forget to set the BLASTDB variable in the config-m cd ../ echo "*****INSTALLING NCBI TAXONOMY" cd $NCBI_tax wget ftp://ftp.ncbi.nlm.nih.gov/pub/taxonomy/taxdump.tar.gz tar -xvf taxdump.tar.gz echo "Do not forget to set the TAXDUMP variable in the config-m cd ../ echo "Access the link below to make host genome index for bmtag echo "https://github.com/bxlab/metaWRAP/blob/master/installatio cd ; break;; [Nn]* ) exit;; esac done #Install SAMSA2 cd $HOME/omics_course/progs git clone https://github.com/transcript/samsa2.git SAMSA2DIR=$HOME/omics_course/progs/samsa2 test -d $SAMSA2DIR || mkdir $SAMSA2DIR cd $SAMSA2DIR/setup_and_test chmod u+x package_installation.bash sed -i 's/install_packages.R/install_packages_R_3.6.R/g' package_installation.bash ./package_installation.bash