Skip to content

1. Installation

Tim Kahlke edited this page Oct 16, 2021 · 6 revisions

Install using Conda

It's recommended to install python in a conda environment as follows:

# Create a conda ennvironment called basta_py3
conda create -n basta_py3 python=3

# Activate the conda environment
conda activate basta_py3

# Download and install dependencies
conda install -c bioconda -c conda-forge leveldb plyvel krona wget

# Clone the github directory
git clone https://github.com/timkahlke/BASTA.git
cd BASTA
python setup.py install

After install you can run unittests to check your installation with

python -m unittest discover basta

If everything is ok you should the results of the unittest with a final "OK".

BASTA native install

BASTA depends on LevelDB and the python wrapper Plyvel as well as a few non-standard python libraries which can easily be installed using pip.

Required Python Libraries (non levelDB)

  • gzip
  • hashlib

The easiest way to install the libraries is using the python package manager pip

pip install gzip hashlib

LevelDB

LevelDB installation: MacOSX

The easiest way to install BASTA on MacOSX is through homebrew (https://brew.sh/) and pip.

brew install leveldb
pip install Plyvel

NOTE Often MacOSX can't find the leveldb header files. If so try:

pip install --global-option=build_ext --global-option="-I/usr/local/include" --global-option="-L/usr/local/lib" Plyvel

LevelDB installation: Ubuntu

LevelDB can be installed using aptitude:

sudo apt-get update
sudo apt-get install python-leveldb
pip install Plyvel

Why LevelDB ?

Currently, BASTA uses levelDB (https://github.com/google/leveldb) for storage of NCBI taxonomies and mapping files. The reason is that the otherwise preferred database system SQLite can lead to locking errors when used on infrastructure that mounts hard drives using Network File System (NFS) which is often the case on compute clusters.


Installing BASTA

BASTA is written in python3, i.e., it doesn't have to be compiled. However, the python scripts have to be put in the proper directories.

First download the BASTA repository to your current directory using git

git clone https://github.com/timkahlke/BASTA.git

Change into the BASTA repository and install BASTA:

cd BASTA
python setup.py install

Krona (optional)

BASTA provides a custom script to create Krona plots (https://github.com/marbl/Krona/wiki) from annotation files. To install KronaTools please follow the Krona installation guide.