-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from EBI-Metagenomics/dev
Merge DEV into Master
- Loading branch information
Showing
48 changed files
with
6,024 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
from ruamel.yaml import YAML | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# EMG-Viral pipeline ENV script | ||
. /hps/software/users/rdf/metagenomics/service-team/envs/mitrc.sh | ||
|
||
mitload virify env | ||
|
||
# virify scripts | ||
_addpath "/nfs/production/rdf/metagenomics/pipelines/prod/emg-viral-pipeline/bin/" | ||
|
||
DATABASES="/nfs/production/rdf/metagenomics/pipelines/prod/emg-viral-pipeline/cwl/databases" | ||
|
||
export VIRSORTER_DATA="${DATABASES}/virsorter-data" | ||
export ADDITIONAL_HMMS_DATA="${DATABASES}/additional_data_vpHMMs_v2.tsv" | ||
export HMMSCAN_DATABASE="${DATABASES}/hmmer_databases/vpHMM_database_v3/vpHMM_database_v3.hmm" | ||
export NCBI_TAX_DB_FILE="${DATABASES}/2020-07-01_ete3_ncbi_tax.sqlite" | ||
export IMGVR_BLAST_DB="${DATABASES}/IMG_VR_2018-07-01_4" | ||
export VIRFINDER_MODEL="${DATABASES}/virfinder/VF.modEPV_k8.rda" | ||
|
||
# workdir | ||
# required to be shared because | ||
# - https://toil.readthedocs.io/en/latest/running/hpcEnvironments.html#standard-output-error-from-batch-system-jobs | ||
# TODO this was seted in virify.sh | ||
export TMPDIR="/tmp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
#!/bin/bash | ||
#SBATCH --cpus-per-task=1 | ||
#SBATCH --ntasks=1 | ||
#SBATCH --mem 8G | ||
#SBATCH --output="%x_virify.out" | ||
#SBATCH --error="%x_virify.err" | ||
|
||
set -e | ||
|
||
usage() { | ||
echo "" | ||
echo "Wrapper script to run the virify workflow using toil-cwl-runner." | ||
echo "" | ||
echo "Results will be stored in the output folder," | ||
echo "under a subfolder named '<job_name>_<timestamp>/'" | ||
echo "-n Job name [mandatory]." | ||
echo "-i Input fasta file (full path) [mandatory]." | ||
echo "-o Output [mandatory]." | ||
echo "-f Length filter (default 1.0)." | ||
echo "" | ||
} | ||
|
||
# Defaults | ||
CORES=4 | ||
MEMORY=8000 # 8GB | ||
LEN_FILTER=1.0 | ||
|
||
while getopts "n:i:o:f:h" opt; do | ||
case $opt in | ||
n) | ||
NAME_RUN="$OPTARG" | ||
if [ -z "$NAME_RUN" ]; then | ||
echo "" | ||
echo "ERROR -n cannot be empty." >&2 | ||
usage | ||
exit 1 | ||
fi | ||
;; | ||
i) | ||
INPUT_FASTA="${OPTARG}" | ||
if [ -z "${INPUT_FASTA}" ]; then | ||
echo "" | ||
echo "ERROR -i cannot be empty." >&2 | ||
usage | ||
exit 1 | ||
fi | ||
;; | ||
o) | ||
OUTDIR="$OPTARG" | ||
if [ -z "$OUTDIR" ]; then | ||
echo "" | ||
echo "ERROR -o cannot be empty." >&2 | ||
usage | ||
exit 1 | ||
fi | ||
mkdir -p "$OUTDIR" | ||
;; | ||
f) | ||
LEN_FILTER="${OPTARG}" | ||
;; | ||
h) | ||
usage | ||
exit 0 | ||
;; | ||
:) | ||
usage | ||
exit 1 | ||
;; | ||
\?) | ||
echo "" | ||
echo "Invalid option -${OPTARG}" >&2 | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
if ((OPTIND == 1)); then | ||
echo "" | ||
echo "ERROR: No options specified" | ||
usage | ||
exit 1 | ||
fi | ||
|
||
shift $((OPTIND - 1)) | ||
|
||
# mandatory params | ||
if [ -z "${NAME_RUN}" ] || | ||
[ -z "${INPUT_FASTA}" ] || | ||
[ -z "${OUTDIR}" ]; then | ||
echo "" | ||
echo "ERROR: Missing mandatory parameter." | ||
usage | ||
exit 1 | ||
fi | ||
|
||
# Embassy env specifics | ||
WORKDIR="/home/virify/workdir" | ||
|
||
echo "Submitting the job." | ||
echo "Workdir: ${WORKDIR}" | ||
echo "Outdir: ${OUTDIR}/${NAME_RUN}" | ||
echo "" | ||
|
||
/home/virify/emg-viral-pipeline/cwl/virify.sh \ | ||
-e /home/virify/scripts/emg-virify-env.sh \ | ||
-n "${NAME_RUN}" \ | ||
-j "${WORKDIR}" \ | ||
-o "${OUTDIR}" \ | ||
-f "${LEN_FILTER}" \ | ||
-c "${CORES}" \ | ||
-m "${MEMORY}" \ | ||
-i "${INPUT_FASTA}" \ | ||
-p embassy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.