Commit 8dba0a4a by Riccardo Vicedomini

hmmsearch output is now compressed while it's being generated

parent 11260ff8
...@@ -197,14 +197,13 @@ fi ...@@ -197,14 +197,13 @@ fi
# Run hmmsearch for each model of the library against the input sequences # Run hmmsearch for each model of the library against the input sequences
print_status "running hmmsearch against input sequences" print_status "running hmmsearch against input sequences"
HMMSEARCH_RESDIR="${PV_TMPDIR}"/hmmsearch HMMSEARCH_RESFILE="${PV_TMPDIR}"/hmmsearch.out.gz
mkdir -p "${HMMSEARCH_RESDIR}"
for hmm in "${PV_LIBDIR}"/hmm/*.hmm; do for hmm in "${PV_LIBDIR}"/hmm/*.hmm; do
[ -e "${hmm}" ] || continue [ -e "${hmm}" ] || continue
hmmBase=${hmm##*/} hmmBase=${hmm##*/}
hmmName=${hmmBase%.hmm} hmmName=${hmmBase%.hmm}
echo "hmmsearch -o ${HMMSEARCH_RESDIR}/${hmmName}.out ${hmm} ${INPUT_FASTA} 2>>${PV_LOGFILE}" echo "hmmsearch ${hmm} ${INPUT_FASTA} 2>>${PV_LOGFILE}"
done | ${PEXEC_CMD} done | ${PEXEC_CMD} | gzip -c >"${HMMSEARCH_RESFILE}"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
print_error "error during hmmsearch jobs, see log: ${PV_LOGFILE}" print_error "error during hmmsearch jobs, see log: ${PV_LOGFILE}"
exit 1 exit 1
...@@ -213,10 +212,7 @@ fi ...@@ -213,10 +212,7 @@ fi
print_status "processing hmmsearch output files" print_status "processing hmmsearch output files"
PV_HMMLIB="${PV_LIBDIR}"/"${PV_LIBNAME}".hmmdict.pgz PV_HMMLIB="${PV_LIBDIR}"/"${PV_LIBNAME}".hmmdict.pgz
PV_SCOREFILE="${PV_TMPDIR}"/hmmsearch.scores PV_SCOREFILE="${PV_TMPDIR}"/hmmsearch.scores
for f in "${HMMSEARCH_RESDIR}"/*.out; do zcat "${HMMSEARCH_RESFILE}" | python3 "${SCRIPTS_DIR}"/parseHMMER.py --hmmer-dict "${PV_HMMLIB}" --seq-db "${PV_SEQDESC}" >"${PV_SCOREFILE}" 2>>"${PV_LOGFILE}"
[ -e "${f}" ] || continue
cat "${f}"
done | python3 "${SCRIPTS_DIR}"/parseHMMER.py --hmmer-dict "${PV_HMMLIB}" --seq-db "${PV_SEQDESC}" >"${PV_SCOREFILE}" 2>>"${PV_LOGFILE}"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
print_error "error during processing of hmmsearch results, see log: ${PV_LOGFILE}" print_error "error during processing of hmmsearch results, see log: ${PV_LOGFILE}"
exit 1 exit 1
......
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