Skip to content

Commit

Permalink
Merge pull request #384 from widdowquinn/issue_377
Browse files Browse the repository at this point in the history
Move `fastANI` to a separate `requirements`
  • Loading branch information
baileythegreen authored Mar 30, 2022
2 parents 6d669d1 + 9108d01 commit 71c5488
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
@conda install --file requirements-pyqt-conda.txt --yes
@pip install -r requirements-pip.txt
@pre-commit install
Expand Down Expand Up @@ -55,7 +56,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
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,26 +171,68 @@ 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.

- **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

**The legacy BLAST executable available from NCBI will not run on macOS Big Sur.**

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 (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.*

##### 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, and other solutions that may be shared there, 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)
Expand Down
1 change: 1 addition & 0 deletions requirements-fastani.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fastani
1 change: 0 additions & 1 deletion requirements-thirdparty.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
blast
blast-legacy
mummer
fastani

0 comments on commit 71c5488

Please sign in to comment.