Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update mykrobe to v0.6.1 #13566

Merged
merged 19 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"