Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions scripts/umgap-analyse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ getconfigdir() {
fi
}

# List the entries of the configuration directory, name only. find's -printf is a
# GNU extension and is not available on the BSD find shipped with macOS.
list_versions() {
for entry in "$(getconfigdir)"/*; do
[ -e "$entry" ] || [ -L "$entry" ] || continue
basename "$entry"
done | sort -n
}

# =========================================================================== #
# Environmental checks.
# =========================================================================== #
Expand Down Expand Up @@ -235,8 +244,7 @@ umgap-setup again."
fi
fi

versions="$(find -H "$(getconfigdir)" -mindepth 1 -maxdepth 1 \
-printf '%P\n' | sort -n)"
versions="$(list_versions)"
for candidate in $versions; do
[ ! -h "$(getconfigdir)/$candidate/taxons.tsv" ] && continue
[ "$tryptic_used" = "true" -a ! -h "$(getconfigdir)/$candidate/tryptic.fst" ] && continue
Expand Down
12 changes: 10 additions & 2 deletions scripts/umgap-visualize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ getconfigdir() {
fi
}

# List the entries of the configuration directory, name only. find's -printf is a
# GNU extension and is not available on the BSD find shipped with macOS.
list_versions() {
for entry in "$(getconfigdir)"/*; do
[ -e "$entry" ] || [ -L "$entry" ] || continue
basename "$entry"
done | sort -n
}

# =========================================================================== #
# Argument parsing.
# =========================================================================== #
Expand Down Expand Up @@ -105,8 +114,7 @@ fi

debug "checking if we have a taxons file for the frequency table"
if [ "$type" = "csv" ]; then
versions="$(find -H "$(getconfigdir)" -mindepth 1 -maxdepth 1 \
-printf '%P\n' | sort -n)"
versions="$(list_versions)"
for candidate in $versions; do
[ ! -h "$(getconfigdir)/$candidate/taxons.tsv" ] && continue
version="$candidate"
Expand Down
Loading