Skip to content

Commit

Permalink
feat(htsinfer): support Conda execution
Browse files Browse the repository at this point in the history
  • Loading branch information
uniqueg committed Feb 11, 2024
1 parent 0845f75 commit c085c87
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
run: bash tests/test_integration_workflow/test.local.sh

- name: Run htsinfer test script
run: bash tests/test_htsinfer_workflow/test.local.sh
run: bash tests/test_htsinfer_with_singularity/test.local.sh

- name: Run SRA downloads workflow
run: bash tests/test_sra_download_with_singularity/test.local.sh
Expand Down Expand Up @@ -208,6 +208,9 @@ jobs:
- name: Run test script
run: bash tests/test_integration_workflow_with_conda/test.local.sh

- name: Run htsinfer test script
run: bash tests/test_htsinfer_with_conda/test.local.sh

- name: Run SRA downloads workflow
run: bash tests/test_sra_download_with_conda/test.local.sh

45 changes: 45 additions & 0 deletions tests/test_htsinfer_with_conda/test.local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

# This script is currently exiting with non-zero status.
# This is expected behaviour though, as several parameters can't be inferred from the test files.
# Snakemake called with --keep-incomplete in order to keep the created samples table for inspection.

# Tear down test environment
cleanup () {
rc=$?
rm -rf .cache/
rm -rf .config/
rm -rf .fontconfig/
rm -rf .java/
rm -rf .snakemake/
rm -rf logs/
rm -rf results/
rm -rf Log.out
cd $user_dir
echo "Exit status: $rc"
}
trap cleanup EXIT

# Set up test environment
set -eo pipefail # ensures that script exits at first command that exits with non-zero status
set -u # ensures that script exits when unset variables are used
set -x # facilitates debugging by printing out executed commands
user_dir=$PWD
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
cd $script_dir

# Run tests
snakemake \
--snakefile="../../workflow/rules/htsinfer.smk" \
--restart-times=0 \
--profile="../../profiles/local-conda" \
--config outdir="results" \
samples="../input_files/htsinfer_samples.tsv" \
samples_out="samples_htsinfer.tsv" \
log_dir="logs" \
cluster_log_dir="logs/cluster_log" \
--notemp \
--keep-incomplete

# Check md5 sum of some output files
md5sum --check "expected_output.md5"
3 changes: 3 additions & 0 deletions tests/test_htsinfer_with_singularity/expected_output.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1dc3f566f896b72f8f0ab8b3d60da364 results/samples_htsinfer.tsv
ca3f9ef26821bfa061d3b7708823ebc3 results/htsinfer_SRR1.json
62303261f8dd73124c2a5a54cd28e572 results/htsinfer_SRR2.json
File renamed without changes.
2 changes: 1 addition & 1 deletion workflow/envs/htsinfer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
channels:
- bioconda
dependencies:
- htsinfer=0.10.0
- htsinfer=0.11.0
...
4 changes: 2 additions & 2 deletions workflow/rules/htsinfer.smk
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ rule run_htsinfer:
cluster_log_path=CLUSTER_LOG,
threads: 4
singularity:
"docker://zavolab/htsinfer:latest"
"docker://quay.io/biocontainers/htsinfer:0.11.0--pyhdfd78af_1"
conda:
os.path.join(workflow.basedir, "..", "envs", "htsinfer.yaml")
log:
Expand Down Expand Up @@ -82,7 +82,7 @@ rule htsinfer_to_tsv:
SAMPLES_OUT,
threads: 4
singularity:
"docker://zavolab/htsinfer:latest"
"docker://quay.io/biocontainers/htsinfer:0.11.0--pyhdfd78af_1"
conda:
os.path.join(workflow.basedir, "..", "envs", "htsinfer.yaml")
log:
Expand Down

0 comments on commit c085c87

Please sign in to comment.