Skip to content

Commit

Permalink
update mykrobe to v0.6.1 (#13566)
Browse files Browse the repository at this point in the history
* [x] I have read the [guidelines for bioconda recipes](https://bioconda.github.io/guidelines.html).
* [ ] This PR adds a new recipe.
* [x] AFAIK, this recipe **is directly relevant to the biological sciences** (otherwise, please submit to the more general purpose [conda-forge channel](https://conda-forge.org/docs/)).
* [x] This PR updates an existing recipe.
* [ ] This PR does something else (explain below).

As this is my first recipe (technically an update, but I effectively had to write from scratch as the program has changed quite a lot) it would be great to have a review from the core team.
  • Loading branch information
Michael Hall authored and bgruening committed Feb 15, 2019
1 parent cae45d3 commit 16b93f8
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 30 deletions.
34 changes: 33 additions & 1 deletion recipes/mykrobe/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
#!/bin/bash
set -x

$PYTHON setup.py install --single-version-externally-managed --record=record.txt
# specify zlib location https://bioconda.github.io/troubleshooting.html#zlib-errors
export CFLAGS="-I$PREFIX/include"
export LDFLAGS="-L$PREFIX/lib"
export CPATH="$PREFIX/include"

# download phelim's fork of mccortex
MCCORTEX_DIR=mccortex
MCCORTEX_GIT="https://github.com/phelimb/mccortex"
mkdir "$MCCORTEX_DIR"
git clone --recursive -b geno_kmer_count "$MCCORTEX_GIT" "$MCCORTEX_DIR"
cd "$MCCORTEX_DIR"

# comment this out as it overrides my LDFLAGS variable
sed -i.bak 's/LDFLAGS =/#LDFLAGS =/' libs/htslib/Makefile
# gcc is hard-coded into Makefile. Comment out to use the conda gcc
sed -i.bak 's/^CC/#CC/' libs/htslib/Makefile

# point some -lz calls to zlib location
for make_file in libs/string_buffer/Makefile $(find libs/seq_file -name Makefile) $(find libs/seq-align -name Makefile) Makefile; do
sed -i.bak 's/-lz/-lz $(LDFLAGS)/' $make_file
done

make MAXK=31

mkdir -p $PREFIX/bin
install -p bin/mccortex31 $PREFIX/bin/

cd ../

"$PYTHON" -m pip install . --no-deps -vv

rm -rf "$MCCORTEX_DIR"
63 changes: 34 additions & 29 deletions recipes/mykrobe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
{% set version = "0.6.1" %}

package:
name: mykrobe
version: "0.5.6"
name : mykrobe
version: {{ version }}

source:
url: https://github.com/iqbal-lab/Mykrobe-predictor/archive/933301d9f1e673a2a282255426a885ef72e67c07.tar.gz
sha256: adcf75a8e873192047921947ef6c367fadee9dff09637f0acad7a4c9c4bcf53e
url : https://github.com/Mykrobe-tools/mykrobe/archive/{{ version }}.tar.gz
sha256 : 5452abf82cb5d3930afc2bc20eaa07b0463403218a1534f036b256dc22aea802
md5 : 2650bfab3caa6ac9e142fb19d55f5604

build:
# dependency mykatlas currently not built for osx
skip: True # [osx]
number: 1
entry_points:
- mykrobe = mykrobe.mykrobe_predictor:main
number: 0
skip: True # [py27]
entry_points:
- mykrobe = mykrobe.cli:main

requirements:
host:
- python
- setuptools

build:
- {{ compiler('cxx') }}
host:
- python
- pip
- zlib
- wget
run:
- python
- mongodb >3.0
- wget
- zlib

run:
- python
- mykatlas
- ga4ghmongo
- mongoengine
- future
test:
# Python imports
imports:
- mykrobe
commands:
- mykrobe --help

commands:
- mykrobe --version
- mykrobe --help
- mykrobe predict --help
- mykrobe variants --help
- mykrobe genotype --help
- 'mccortex31 2>&1 | head -n2 | grep "^usage: "'

about:
home: https://github.com/iqbal-lab/Mykrobe-predictor
license: Custom non-commercial license
license_file: LICENSE
summary: 'Rapid antibiotic-resistance predictions from genome sequence data for Staphylococcus aureus and Mycobacterium tuberculosis.'
home: https://github.com/Mykrobe-tools/mykrobe
license: MIT
license_file: LICENSE
summary: 'Rapid antibiotic-resistance predictions from genome sequence data for Staphylococcus aureus and Mycobacterium tuberculosis.'
32 changes: 32 additions & 0 deletions recipes/mykrobe/post-link.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# This script downloads the panel data that mykrobe uses for its predictions

cd "$PREFIX" || exit 1
TARBALL="mykrobe-data.tar.gz"
URLS=(
"https://bit.ly/2H9HKTU"
)
SHA256="14b4e111d8b17a43dd30e3a55416bab79794ed56c44acc6238e1fd10addd0a03"
SUCCESS=0

for URL in "${URLS[@]}"; do
wget -O - "${URL}" > "$TARBALL"
[[ $? == 0 ]] || continue

if [[ $(shasum -a 256 $TARBALL | cut -f1 -d " ") == "$SHA256" ]]; then
SUCCESS=1
break
fi

done

if [[ $SUCCESS != 1 ]]; then
echo "ERROR: post-link.sh was unable to download any of the following URLs with the shasum $SHA256:" >> "${PREFIX}/.messages.txt" 2>&1
printf '%s\n' "${URLS[@]}" >> "${PREFIX}/.messages.txt" 2>&1
exit 1
fi

tar -vxzf "$TARBALL"
rm -fr "$PREFIX"/src/mykrobe/data
mv mykrobe-data "$PREFIX"/src/mykrobe/data
rm "$TARBALL"

0 comments on commit 16b93f8

Please sign in to comment.