Commit 7a7a63f8 by Riccardo Vicedomini

metaclade2 now accepts a custom config file to override some default settings

parent ad11e4b2
......@@ -33,6 +33,7 @@ DAMA_OLPMAXDOM=50
MCLADE_USEDAMA=false
MCLADE_USESGE=false
MCLADE_WORKDIR=${PWD}
MCLADE_USERCFG_ARG=""
MCLADE_OUTFILE=""
MCLADE_RMTMP=false
NTHREADS=4
......@@ -57,6 +58,7 @@ function print_usage() {
-D, --domain-file <path>\tFile that contains the Pfam accession numbers\n
\tof the domains to be considered (one per line)\n
-W, --work-dir <path>\tWorking directory (default:current directory)\n
-U, --user-cfg <path>\tUser config file for overriding default MetaCLADE2 configuration\n
--remove-temp\tRemove temporary intermediate files, keeping only results and logs\n
" | column -t -s $'\t'
echo -en "\n"
......@@ -90,8 +92,8 @@ function print_usage() {
# retrieve provided arguments
opts="N:i:o:ad:D:e:E:W:t:j:hV"
longopts="name:,input:,output:,arch,domain-list:,domain-file:,evalue-cutoff:,evalue-cutconf:,overlappingAA:,overlappingMaxDomain:,work-dir,remove-temp,threads:,jobs:,help,version,sge,pe:,queue:,time-limit:"
opts="N:i:o:ad:D:e:E:W:U:t:j:hV"
longopts="name:,input:,output:,arch,domain-list:,domain-file:,evalue-cutoff:,evalue-cutconf:,overlappingAA:,overlappingMaxDomain:,work-dir:,user-cfg:,remove-temp,threads:,jobs:,help,version,sge,pe:,queue:,time-limit:"
ARGS=$(getopt -o "${opts}" -l "${longopts}" -n "${CMD_NAME}" -- "${@}")
if [ $? -ne 0 ] || [ $# -eq 0 ]; then # do not change the order of this test!
print_usage
......@@ -144,6 +146,10 @@ while [ -n "${1}" ]; do
shift
MCLADE_WORKDIR=${1}
;;
-U|--user-cfg)
shift
MCLADE_USERCFG_ARG="--config ${1}"
;;
--remove-temp)
MCLADE_RMTMP=true
;;
......@@ -272,7 +278,13 @@ print_status "creating MetaCLADE script/job files"
python3 "${SCRIPTS_DIR}/mclade_create_jobs.py" \
-i "${INPUT_FASTA}" -N "${MCLADE_JOBNAME}" ${MCLADE_DOMARG} -W "${MCLADE_WORKDIR}" \
-e "${MCLADE_EVALUECUTOFF}" -E "${MCLADE_EVALUECUTCONF}" --overlappingAA ${DAMA_OLPAA} --overlappingMaxDomain ${DAMA_OLPMAXDOM} ${MCLADE_DAMAARG} \
-j "${NJOBS}" >"${MCLADE_WORKDIR}/log/mclade_create_jobs.out" 2>"${MCLADE_WORKDIR}/log/mclade_create_jobs.err"
-j "${NJOBS}" \
${MCLADE_USERCFG_ARG} \
>"${MCLADE_WORKDIR}/log/mclade_create_jobs.out" 2>"${MCLADE_WORKDIR}/log/mclade_create_jobs.err"
if [ $? -ne 0 ]; then
print_error "cannot create MetaCLADE job files"
exit 1
fi
# Run MetaCLADE scripts (possibly using SGE)
......@@ -290,7 +302,7 @@ for i in $(seq 1 ${NJOBS}); do
pidarr[$i]=$pid
else
${CMD} >"${MCLADE_WORKDIR}/log/search_${i}.out" 2>"${MCLADE_WORKDIR}/log/search_${i}.err"
cmdret=$?; if (( cmdret != 0 )); then print_error "search job failed (exit status: ${cmdret})"; exit 1; fi
cmdret=$?; if [ $cmdret -ne 0 ]; then print_error "search job failed (exit status: ${cmdret})"; exit 1; fi
fi
fi
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment