Skip to content

Commit

Permalink
Update PhyloAcc recipe (#51224)
Browse files Browse the repository at this point in the history
  • Loading branch information
gwct authored Oct 10, 2024
1 parent 74759f4 commit 661a0a5
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 5 deletions.
8 changes: 3 additions & 5 deletions recipes/phyloacc/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source:
sha256: {{ sha256 }}

build:
number: 1
number: 2
skip: True # [py < 311]
run_exports:
- {{ pin_subpackage('phyloacc', max_pin="x") }}
Expand Down Expand Up @@ -41,10 +41,8 @@ requirements:
- llvm-openmp # [osx]

test:
commands:
- phyloacc.py --version
- phyloacc.py --depcheck
- phyloacc_post.py -h
requires:
- wget

about:
home: https://phyloacc.github.io/
Expand Down
61 changes: 61 additions & 0 deletions recipes/phyloacc/run_test.sh
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."

0 comments on commit 661a0a5

Please sign in to comment.