Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/soedinglab/mmseqs2
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-steinegger committed Oct 28, 2017
2 parents 42bc5d5 + 8e90737 commit c7a89b6
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion data/assembler.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Assembler workflow script
checkReturnCode () {
[ $? -ne 0 ] && echo "$1" && exit 1;
Expand Down
4 changes: 2 additions & 2 deletions data/blastp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/bash -e
# Sequence search workflow script
fail() {
echo "Error: $1"
Expand Down Expand Up @@ -69,7 +69,7 @@ while [ $STEP -lt $STEPS ]; do
|| fail "Awk step $SENS died"
fi

if [[ ! -s "$TMP_PATH/order_step$SENS" ]]; then break; fi
if [ ! -s "$TMP_PATH/order_step$SENS" ]; then break; fi

if notExists "$NEXTINPUT"; then
$MMSEQS createsubdb "$TMP_PATH/order_step$SENS" "$INPUT" "$NEXTINPUT" \
Expand Down
2 changes: 1 addition & 1 deletion data/blastpgp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/bash -e
# Iterative sequence search workflow script
fail() {
echo "Error: $1"
Expand Down
2 changes: 1 addition & 1 deletion data/cascaded_clustering.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Clustering workflow script
# helper functions
checkReturnCode () {
Expand Down
2 changes: 1 addition & 1 deletion data/clustering.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/bash -e
# Clustering workflow script
fail() {
echo "Error: $1"
Expand Down
2 changes: 1 addition & 1 deletion data/linclust.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Clustering workflow script
checkReturnCode () {
[ $? -ne 0 ] && echo "$1" && exit 1;
Expand Down
2 changes: 1 addition & 1 deletion data/searchtargetprofile.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/bash -e
fail() {
echo "Error: $1"
exit 1
Expand Down
30 changes: 15 additions & 15 deletions data/taxonomy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/bash -e

fail() {
echo "Error: $1"
Expand Down Expand Up @@ -29,8 +29,8 @@ abspath() {
[ ! -f "$1" ] && echo "$1 not found!" && exit 1;
[ ! -f "$2" ] && echo "$2 not found!" && exit 1;
[ ! -f "$3" ] && echo "$3 not found!" && exit 1;
if [[ -n "${LCA_PAR}" ]]; then
([[ ! -f "$4/names.dmp" ]] || [[ ! -f "$4/nodes.dmp" ]]) && echo "Required NCBI Taxonomy files missing!" && exit 1;
if [ -n "${LCA_PAR}" ]; then
([ ! -f "$4/names.dmp" ] || [ ! -f "$4/nodes.dmp" ]) && echo "Required NCBI Taxonomy files missing!" && exit 1;
NCBI_TAXDUMP="$(abspath "$4")"
fi
[ -f "$5" ] && echo "$5 exists already!" && exit 1;
Expand All @@ -42,7 +42,7 @@ TAXON_MAPPING="$(abspath "$3")"
RESULTS="$(abspath "$5")"
TMP_PATH="$(abspath "$6")"

if [[ ! -e "${TMP_PATH}/first" ]]; then
if [ ! -e "${TMP_PATH}/first" ]; then
mkdir -p "${TMP_PATH}/tmp_hsp1"
$MMSEQS search "${INPUT}" "${TARGET}" "${TMP_PATH}/first" "${TMP_PATH}/tmp_hsp1" ${SEARCH1_PAR} \
|| fail "First search died"
Expand All @@ -51,18 +51,18 @@ fi
LCA_SOURCE="${TMP_PATH}/first"

# 2bLCA mode
if [[ -n "${SEARCH2_PAR}" ]]; then
if [[ ! -e "${TMP_PATH}/top1" ]]; then
if [ -n "${SEARCH2_PAR}" ]; then
if [ ! -e "${TMP_PATH}/top1" ]; then
$MMSEQS filterdb "${TMP_PATH}/first" "${TMP_PATH}/top1" --extract-lines 1 \
|| fail "Filterdb died"
fi

if [[ ! -e "${TMP_PATH}/aligned" ]]; then
if [ ! -e "${TMP_PATH}/aligned" ]; then
$MMSEQS extractalignedregion "${TMP_PATH}/top1" "${TARGET}" "${TMP_PATH}/top1" "${TMP_PATH}/aligned" --extract-mode 2 \
|| fail "Extractalignedregion failed"
fi

if [[ ! -e "${TMP_PATH}/round2" ]]; then
if [ ! -e "${TMP_PATH}/round2" ]; then
mkdir -p "${TMP_PATH}/tmp_hsp2"
$MMSEQS search "${TMP_PATH}/aligned" "${TARGET}" "${TMP_PATH}/round2" "${TMP_PATH}/tmp_hsp2" ${SEARCH2_PAR} \
|| fail "Second search died"
Expand All @@ -71,30 +71,30 @@ if [[ -n "${SEARCH2_PAR}" ]]; then
# Concat top hit from first search with all the results from second search
# We can use filterdb --beats-first to filter out all entries from second search that
# do not reach the evalue of the top 1 hit
if [[ ! -e "${TMP_PATH}/merged" ]]; then
if [ ! -e "${TMP_PATH}/merged" ]; then
$MMSEQS mergedbs "${TMP_PATH}/top1" "${TMP_PATH}/merged" "${TMP_PATH}/top1" "${TMP_PATH}/round2" \
|| fail "Mergedbs died"
fi

if [[ ! -e "${TMP_PATH}/2b_ali" ]]; then
if [ ! -e "${TMP_PATH}/2b_ali" ]; then
$MMSEQS filterdb "${TMP_PATH}/merged" "${TMP_PATH}/2b_ali" --beats-first --filter-column 4 --comparison-operator le \
|| fail "First filterdb died"
fi

LCA_SOURCE="${TMP_PATH}/2b_ali"
fi

if [[ ! -e "${TMP_PATH}/mapping" ]]; then
if [ ! -e "${TMP_PATH}/mapping" ]; then
$MMSEQS filterdb "${LCA_SOURCE}" "${TMP_PATH}/mapping" --filter-column 1 --mapping-file "${TAXON_MAPPING}" \
|| fail "Second filterdb died"
fi

if [[ ! -e "${TMP_PATH}/taxa" ]]; then
if [ ! -e "${TMP_PATH}/taxa" ]; then
$MMSEQS filterdb "${TMP_PATH}/mapping" "${TMP_PATH}/taxa" --filter-column 1 --trim-to-one-column \
|| fail "Third filterdb died"
fi

if [[ -n "${LCA_PAR}" ]]; then
if [ -n "${LCA_PAR}" ]; then
$MMSEQS lca "${TMP_PATH}/taxa" "${NCBI_TAXDUMP}" "${RESULTS}" ${LCA_PAR} \
|| fail "Lca died"
else
Expand All @@ -108,13 +108,13 @@ if [ -n "${REMOVE_TMP}" ]; then
rm -rf "${TMP_PATH}/tmp_hsp2"
rm -f "${TMP_PATH}/first" "${TMP_PATH}/first.index"

if [[ -n "${SEARCH2_PAR}" ]]; then
if [ -n "${SEARCH2_PAR}" ]; then
rm -f "${TMP_PATH}/top1" "${TMP_PATH}/top1.index"
rm -f "${TMP_PATH}/aligned" "${TMP_PATH}/aligned.index" "${TMP_PATH}/round2" "${TMP_PATH}/round2.index"
rm -f "${TMP_PATH}/merged" "${TMP_PATH}/merged.index" "${TMP_PATH}/2b_ali" "${TMP_PATH}/2b_ali.index"
fi

if [[ -n "${LCA_PAR}" ]]; then
if [ -n "${LCA_PAR}" ]; then
rm -f "${TMP_PATH}/mapping" "${TMP_PATH}/mapping.index" "${TMP_PATH}/taxa" "${TMP_PATH}/taxa.index"
else
rm -f "${TMP_PATH}/mapping" "${TMP_PATH}/mapping.index"
Expand Down

0 comments on commit c7a89b6

Please sign in to comment.