-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
5 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
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,61 @@ | ||
#!/bin/bash | ||
set -e | ||
set -o pipefail | ||
set -x | ||
|
||
# Runs test for PhyloAcc, including on a small simulated dataset that contains a fasta file, mod file, | ||
# bed file, id subset file, and config file. | ||
|
||
TMP=$(mktemp -d) | ||
trap 'rm -rf $TMP' EXIT | ||
export TMPDIR=$TMP | ||
cd $TMP | ||
|
||
echo " ** DOWNLOADING TEST DATA." | ||
files=( | ||
"bioconda-test-cfg.yaml" | ||
"id-subset.txt" | ||
"ratite.mod" | ||
"simu_500_200_diffr_2-1.bed" | ||
"simu_500_200_diffr_2-1.noanc.fa" | ||
) | ||
|
||
for file in "${files[@]}"; do | ||
if ! wget -q "https://github.com/phyloacc/PhyloAcc-test-data/raw/main/bioconda-test-data/$file"; then | ||
echo "Failed to download $file" >&2 | ||
exit 1 | ||
fi | ||
done | ||
echo " ** TEST DATA DOWNLOAD OK." | ||
|
||
echo " ** BEGIN DEPCHECK TEST." | ||
if ! phyloacc --depcheck; then | ||
echo " ** ERROR: Dependency check failed. Please ensure all dependencies are installed." >&2 | ||
exit 1 | ||
fi | ||
echo " ** DEPCHECK TEST OK." | ||
|
||
echo " ** BEGIN PHYLOACC INTERFACE TEST." | ||
if ! phyloacc --config bioconda-test-cfg.yaml --local; then | ||
echo " ** ERROR: PhyloAcc interface test failed. Please check the configuration and installation." >&2 | ||
exit 1 | ||
fi | ||
echo " ** INTERFACE TEST OK." | ||
|
||
echo " ** BEGIN WORKFLOW TEST." | ||
if ! snakemake -p --jobs 1 --cores 1 -s phyloacc-bioconda-test/phyloacc-job-files/snakemake/run_phyloacc.smk --configfile phyloacc-bioconda-test/phyloacc-job-files/snakemake/phyloacc-config.yaml; then | ||
echo " ** ERROR: PhyloAcc workflow test failed. Please check the Snakemake configuration and log files." >&2 | ||
exit 1 | ||
fi | ||
echo " ** WORKFLOW TEST OK." | ||
|
||
echo " ** BEGIN POST-PROCESSING TEST." | ||
if ! phyloacc_post.py -h; then | ||
echo " ** ERROR: Failed to display help message for phyloacc_post.py" >&2 | ||
exit 1 | ||
fi | ||
if ! phyloacc_post.py -i phyloacc-bioconda-test/; then | ||
echo " ** ERROR: Post-processing test failed. Please check the input directory and log files." >&2 | ||
exit 1 | ||
fi | ||
echo " ** POST-PROCESSING TEST OK." |