From fb6a149dff188625c9a4c84046b5910f42fbed29 Mon Sep 17 00:00:00 2001 From: baileythegreen Date: Tue, 1 Feb 2022 02:14:38 +0000 Subject: [PATCH 1/3] Move `fastANI` to a separate `requirements` Sidesteps macOS/Python3.9 issues with the `fastANI` `conda` recipe. --- README.md | 46 +++++++++++++++++++++++++++++++++++-- requirements-fastani.txt | 1 + requirements-thirdparty.txt | 1 - 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 requirements-fastani.txt diff --git a/README.md b/README.md index 68610afb..7d49fc94 100644 --- a/README.md +++ b/README.md @@ -171,12 +171,12 @@ pip3 install pyani ### Third-party tools -Three alignment packages are required, to use all of `pyani`'s methods: `mummer`, `BLAST+`, and legacy `BLAST`. (*Note that it is not necessary to install all three tools to use `pyani`. You need only install the tools that are required for the method you wish to use.*) +Four alignment packages are required, to use all of `pyani`'s methods: `mummer`, `BLAST+`, legacy `BLAST`, and `fastANI`. (*Note that it is not necessary to install all four tools to use `pyani`. You need only install the tools that are required for the method you wish to use.*) The simplest route to obtaining these tools is to use `conda`/`bioconda`: ```bash -conda install mummer blast legacy-blast -y +conda install mummer blast legacy-blast fastani -y ``` But they can also be installed by following instructions from the tools' own websites. @@ -184,6 +184,7 @@ But they can also be installed by following instructions from the tools' own web - **BLAST+** (for `anib`) [ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/](ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/) - **legacy BLAST** (for `aniblastall`) [ftp://ftp.ncbi.nlm.nih.gov/blast/executables/release/LATEST/](ftp://ftp.ncbi.nlm.nih.gov/blast/executables/release/LATEST/) - **MUMmer** (for `anim`) [http://mummer.sourceforge.net/](ftp://ftp.ncbi.nlm.nih.gov/blast/executables/release/LATEST/) +- **fastANI** (for `fastani`) [https://github.com/ParBLiSS/FastANI](https://github.com/ParBLiSS/FastANI) ### NOTE: Installing legacy BLAST @@ -191,6 +192,47 @@ But they can also be installed by following instructions from the tools' own web If you wish to use `pyani blastall` or the `ANIblastall` method with the legacy `pyani` interface, you will require a locally-installed copy of this package. This is one of the packages linked in the `requirements-thirdparty.txt` file. +### Note: Installing fastANI + +**`fastANI` installation (via `conda`) will fail for Python 3.9 on macOS.** + +If you are using Python ≥3.9 to run `pyani` on macOS, `fastANI` will fail to install due to errors in the `conda` recipe. Using an earlier version of Python may be the simplest solution. However, you can also install `fastANI` yourself—via `conda`—using a slightly altered version of the command produced from the `conda` recipe, as shown below. + +*N.B. We have placed the `fastANI` requirement in its own `requirements-fastani.txt` file so that this will not also cause other installations to fail.* + +##### Bypassing `conda` + +```bash +c++ -O3 -DNDEBUG -std=c++11 -Isrc \ +-I ${ENV_DIR}/lib/include -mmacosx-version-min=10.7 \ +-stdlib=libc++ -Xpreprocessor -fopenmp -lomp \ +-DUSE_BOOST src/cgi/core_genome_identity.cpp -o fastANI \ +${ENV_DIR}/lib/lib/libboost_math_c99.a \ +-lstdc++ -lz -lm +``` + +Two alterations need to be made to the file name specified in the fifth line here: + +1. One of the `/lib`s should be removed. +1. The file extension should be changed from `.a`, to `.dylib`. + +The resultant command ought to look something like this (with ${ENV_DIR} being wherever you're installing `fastANI`): + +```bash +c++ -O3 -DNDEBUG -std=c++11 -Isrc \ +-I ${ENV_DIR}/lib/include -mmacosx-version-min=10.7 \ +-stdlib=libc++ -Xpreprocessor -fopenmp -lomp \ +-DUSE_BOOST src/cgi/core_genome_identity.cpp -o fastANI \ +${ENV_DIR}/lib/libboost_math_c99.dylib \ +-lstdc++ -lz -lm +``` + +For a more technical overview of the issue, please see https://github.com/widdowquinn/pyani/issues/377. + +##### Troubleshooting + +This solution is how one of our developers managed to solve the problem. We hope it works for you, but can not guarantee this. Unfortunately, if this does not work for you, we will also not be able to troubleshoot the issue. In this instance, please file an issue at https://github.com/bioconda/bioconda-recipes. + ----- ## Documentation (v0.3) diff --git a/requirements-fastani.txt b/requirements-fastani.txt new file mode 100644 index 00000000..633a41df --- /dev/null +++ b/requirements-fastani.txt @@ -0,0 +1 @@ +fastani diff --git a/requirements-thirdparty.txt b/requirements-thirdparty.txt index 71f899f0..bfe39e58 100644 --- a/requirements-thirdparty.txt +++ b/requirements-thirdparty.txt @@ -1,4 +1,3 @@ blast blast-legacy mummer -fastani From 60ca3a6aadef53cb2748ec962e461dc304ee15dd Mon Sep 17 00:00:00 2001 From: baileythegreen Date: Tue, 29 Mar 2022 12:04:33 +0100 Subject: [PATCH 2/3] Add `requirements-fastani.txt` install into `Makefile` --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 629ff1f0..3f2488dc 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ setup_env: @conda install --file requirements-dev.txt --yes @conda install --file requirements.txt --yes @conda install --file requirements-thirdparty.txt --yes + @conda install --file requirements-fastani.txt --yes @pip install -r requirements-pip.txt @pre-commit install @pip install -U -e . @@ -54,7 +55,7 @@ walkthrough: clean_walkthrough # pyani report --runs C_blochmannia_ANIb/ --formats html,excel,stdout # pyani report --run_results 2 --formats html,excel,stdout C_blochmannia_ANIb/ # pyani report --run_matrices 2 --formats html,excel,stdout C_blochmannia_ANIb/ - # pyani plot --formats png,pdf --method seaborn C_blochmannia_ANIb 2 + # pyani plot --formats png,pdf --method seaborn C_blochmannia_ANIb 2 uml: pyreverse -o pdf -p pyani pyani From 2acee92fd036488c35b8e12bc408ac83b00306ed Mon Sep 17 00:00:00 2001 From: Bailey Harrington Date: Tue, 29 Mar 2022 12:14:46 +0100 Subject: [PATCH 3/3] Apply suggestions from code review Be a bit more specific about which `conda` recipe has this problem, and mention that other solutions might be available (dependent upon someone finding them and sharing them here). Co-authored-by: Leighton Pritchard --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7d49fc94..64daa92e 100644 --- a/README.md +++ b/README.md @@ -196,7 +196,7 @@ If you wish to use `pyani blastall` or the `ANIblastall` method with the legacy **`fastANI` installation (via `conda`) will fail for Python 3.9 on macOS.** -If you are using Python ≥3.9 to run `pyani` on macOS, `fastANI` will fail to install due to errors in the `conda` recipe. Using an earlier version of Python may be the simplest solution. However, you can also install `fastANI` yourself—via `conda`—using a slightly altered version of the command produced from the `conda` recipe, as shown below. +If you are using Python ≥3.9 to run `pyani` on macOS, `fastANI` will fail to install due to errors in the `conda` recipe (for build `h0a26cfa_0`). Using an earlier version of Python may be the simplest solution. However, you can also install `fastANI` yourself—via `conda`—using a slightly altered version of the command produced from the `conda` recipe, as shown below. *N.B. We have placed the `fastANI` requirement in its own `requirements-fastani.txt` file so that this will not also cause other installations to fail.* @@ -227,7 +227,7 @@ ${ENV_DIR}/lib/libboost_math_c99.dylib \ -lstdc++ -lz -lm ``` -For a more technical overview of the issue, please see https://github.com/widdowquinn/pyani/issues/377. +For a more technical overview of the issue, and other solutions that may be shared there, please see https://github.com/widdowquinn/pyani/issues/377. ##### Troubleshooting