Skip to content

Commit

Permalink
Added resume flag to zdb setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
bastian committed Mar 29, 2023
1 parent d1cec40 commit 272b4b4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
28 changes: 22 additions & 6 deletions bin/zdb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ elif [[ "$1" == "setup" ]]; then
singularity=true
docker=false
conda=false
resume=false

for i in "$@"; do
case $i in
Expand All @@ -102,6 +103,10 @@ elif [[ "$1" == "setup" ]]; then
singularity=false
shift
;;
--resume)
resume=true
shift
;;
--ko)
db_setup_args="${db_setup_args} --ko"
shift
Expand All @@ -123,16 +128,21 @@ elif [[ "$1" == "setup" ]]; then
shift
;;
--help)
echo "Downloads and sets up the reference database used by the analysis pipeline"
echo "The following options can be used"
echo "Downloads and sets up the reference database used by the analysis pipeline."
echo ""
echo "The following options can be used:"
echo " --cog: downloads the CDD profiles used for COG annotations "
echo " --ko: downloads and setups the hmm profiles of the ko database"
echo " --pfam: downloads and setups up the hmm profiles of the PFAM protein domains"
echo " --swissprot: downloads and indexes the swissprot database "
echo " --dir: directory where to store the reference databases (defaults zdb_ref in the current directory) "
echo ""
echo "Other parameters:"
echo " --dir: directory where to store the reference databases (defaults zdb_ref in the current directory)"
echo " --resume: resume a previously failed execution"
echo ""
echo "Environments (by default, singularity containers are used):"
echo "--conda: uses conda environment to prepare the databases"
echo "--docker: uses docker containers to prepare the databases"
echo " --conda: uses conda environment to prepare the databases"
echo " --docker: uses docker containers to prepare the databases"
echo " --singularity_dir: the directory where the singularity images are downloaded (default singularity in current directory)"
exit 0
;;
Expand All @@ -152,8 +162,14 @@ elif [[ "$1" == "setup" ]]; then
env="--docker=false --conda=false --singularity=true"
fi

if [ "$resume" = true ]; then
echo "Resuming previous run"
db_setup_args="${db_setup_args} -resume"
else
echo "Preparing the reference databases, this will take some time"
fi

db_setup_args="${db_setup_args} --base_db=${dir} ${env} --singularity_dir=${singularity_dir}"
echo "Preparing the reference databases, this will take some time"
nextflow run $NEXTFLOW_DIR/db_setup.nf ${db_setup_args}
echo "Done. The reference databases were prepared in the ${dir} folder"
exit 0
Expand Down
4 changes: 3 additions & 1 deletion db_setup.nf
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ process download_ko_profiles {
"""
}


process download_swissprot {
// not optimal... might be a bit slow to move
publishDir "$params.swissprot_db", mode: "copy"
Expand All @@ -150,7 +151,8 @@ process download_swissprot {
"""
}

process download_swissprot_db {

process prepare_swissprot {
container "$params.blast_container"
conda "$baseDir/conda/blast.yaml"

Expand Down

0 comments on commit 272b4b4

Please sign in to comment.