Skip to content

Commit

Permalink
Add recipe for Poolsnp (bioconda#49156)
Browse files Browse the repository at this point in the history
* Add PoolSNP recipe v1.0.0

* Add run_exports

* Fix linting

* Include test directory

* Specify Testdata destination

* Fix path specifications

* Fix path specification in test.sh

* Potential tests fix

* Add noarch specification

* Adding .py scripts to bin/

* Test fixes

* Add noarch specification

* Streamline tests

* Alter test command

* Separate out tests

* Add release tarball
  • Loading branch information
abhilesh authored Jul 22, 2024
1 parent ac94616 commit 39da4e0
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
33 changes: 33 additions & 0 deletions recipes/poolsnp/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/bash

set -ex

BASE_DIR=$(dirname "$0")
SCRIPTS_DIR="${BASE_DIR}/scripts"
TEST_DATA_DIR="${BASE_DIR}/TestData"

if [ ! -d "${SCRIPTS_DIR}" ]; then
echo "The scripts directory is missing. It should be placed in the same directory as the PoolSNP.sh script."
exit 1
fi

if [ ! -d "${TEST_DATA_DIR}" ]; then
echo "The TestData directory is missing. It should be placed in the same directory as the PoolSNP.sh script."
exit 1
fi

mkdir -p ${PREFIX}/bin
mkdir -p ${PREFIX}/bin/scripts
mkdir -p ${PREFIX}/share/PoolSNP

cp PoolSNP.sh ${PREFIX}/bin
chmod +x ${PREFIX}/bin/PoolSNP.sh

for script in $SCRIPTS_DIR/*; do
cp $script ${PREFIX}/bin/$(basename $script)
cp $script ${PREFIX}/bin/scripts/
chmod +x ${PREFIX}/bin/$(basename $script)
chmod +x ${PREFIX}/bin/scripts/$(basename $script)
done

cp -r ${TEST_DATA_DIR} ${PREFIX}/share/PoolSNP/TestData
40 changes: 40 additions & 0 deletions recipes/poolsnp/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{% set name = "poolsnp" %}
{% set version = "1.0.0" %}
{% set github = "https://github.com/capoony/PoolSNP" %}

package:
name: "{{ name }}"
version: "{{ version }}"

source:
url: "{{ github }}/archive/refs/tags/v.{{ version }}.tar.gz"
sha256: a73c61c7ef49be9bd1212ea8049fe617296b0a82b80e0338e2b78dc55105438f

requirements:
host:
- python
- parallel
run:
- python
- parallel

build:
number: 0
noarch: generic
run_exports:
- {{ pin_subpackage('poolsnp', max_pin='x.x') }}

test:
source_files:
- TestData/*
- scripts/*

about:
summary: PoolSNP is a heuristic SNP caller, which uses an MPILEUP file and a reference genome in FASTA format as inputs.
license: Apache-2.0
license_file: LICENSE
home: https://github.com/capoony/PoolSNP

extra:
recipe-maintainers:
- abhilesh
22 changes: 22 additions & 0 deletions recipes/poolsnp/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Ensure the script is executable
test -x ${PREFIX}/bin/PoolSNP.sh

# Run PoolSNP.sh with a minimal set of parameters to ensure it executes
bash ${PREFIX}/bin/PoolSNP.sh \
mpileup="${PREFIX}/share/PoolSNP/TestData/test.mpileup" \
reference="${PREFIX}/share/PoolSNP/TestData/test.fa" \
names=Sample1,Sample2 \
max-cov=0.7 \
min-cov=4 \
min-count=4 \
min-freq=0.01 \
miss-frac=0.5 \
jobs=4 \
badsites=1 \
allsites=1 \
output=${PREFIX}/share/PoolSNP/TestResult/test

# Optionally, check the output file to ensure it was created
test -f ${PREFIX}/share/PoolSNP/TestResult/test.vcf.gz

0 comments on commit 39da4e0

Please sign in to comment.