-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_kraken2_database.pbs
48 lines (39 loc) · 1.7 KB
/
build_kraken2_database.pbs
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
#!/bin/bash
# This script builds a custome Kraken database.
# Parameters: conda_module (module name for loading conda), env (conda environment), library (bacteria, etc), db (database name), wd (working directory)
# Dependencies: conda (anaconda/miniconda), Kraken 2, PBS
# Example command: qsub -v "conda_module=anaconda3/personal,env=kraken2.1,lib=bacteria,db=bacteria_220526,wd=$PWD" ~/Kraken_toolkit/build_kraken2_database.pbs
#
# Copyright (C) 2020-2022 Yu Wan <[email protected]>
# Licensed under the GNU General Public Licence version 3 (GPLv3) <https://www.gnu.org/licenses/>.
# First release: 2021; latest update: 28 May 2022
### Job configurations ###############
#PBS -N kraken2-build
#PBS -l select=1:ncpus=8:mem=64gb:ompthreads=8
#PBS -l walltime=48:00:00
#PBS -j oe
if [ ! -z "$conda_module"]; then
module load "$conda_module"
fi
if [ ! -z "$env" ]; then # Comment/uncomment the command 'source activate' or 'conda activate' for your HPC's setting
source activate $env # Includes an openmpi installation from bioconda
# conda activate $env
fi
if [ -z "$lib" ]; then
echo "Warning: No library is specified, so this script uses 'bacteria'."
lib='bacteria'
fi
### Main ###############
cd $wd
#echo "Deleting the previous database"
#if [ -d $db ]; then
# rm -rf $db
#fi
echo -e "Using $NCPUS cores to build $db in $wd\n"
echo -e "Download taxonomy\n"
kraken2-build --download-taxonomy --db $db
echo -e "Downloading the bacterial library\n"
kraken2-build --download-library $lib --db $db # This command does not affect files in directory 'taxonomy'
#kraken2-build --download-library bacteria --use-ftp --db $db
echo -e "Building the bacterial database"
kraken2-build --build --threads $NCPUS --db $db