Skip to content

Installation

Martin Vickers edited this page Feb 28, 2022 · 14 revisions

Using biocontainers with docker

There is a maintained version of KAST on biocontainers which can be used with docker. To use this, assuming docker is installed, you need to pull the container. NOTE: you need to specify the version tag like so;

martin@desktop:~$ docker pull biocontainers/kast:v1.0.0_cv1

You may need to do this with administator permissions/sudo, e.g.

martin@desktop:~$ sudo docker pull biocontainers/kast:v1.0.0_cv1

For a list of KAST biocontainer version tags, visit here;

https://hub.docker.com/r/biocontainers/kast/tags

Compile the github master branch from source (ubuntu example)

An example of compiling from source using a modern version of ubuntu (16.04+) is described below.

martin@desktop:~$ sudo apt-get install git g++ build-essential cmake zlib1g-dev libbz2-dev libboost-all-dev
martin@desktop:~$ git clone https://github.com/seqan/seqan.git seqan
martin@desktop:~$ git clone https://github.com/martinjvickers/KAST.git
martin@desktop:~$ cd KAST
martin@desktop:~$ cmake ../KAST -DCMAKE_MODULE_PATH=../seqan/util/cmake -DSEQAN_INCLUDE_PATH=../seqan/include -DCMAKE_CXX_FLAGS=-std=c++14 -DCMAKE_BUILD_TYPE=Release
martin@desktop:~$ make

This creates a binary file which you can either run from it's current location, or copy to /usr/local/bin/ for global access on your machine or copied to ~/bin for local access. This is explained further in Making KAST accessible in your local environment

Static Binary Quick start

This is the easiest way to use KAST if you are starting out and your system is compatible with this. All you need to so is download the latest release and copy this either into your working directory for you to use.

  • Download the the latest release using wget
  • Use tar xvfz to uncompress and extract the binary
  • Run the program

e.g.

martin@desktop:~$ wget https://github.com/martinjvickers/KAST/releases/download/testing_0.0.6/KAST_testing_0.0.6.tar.gz
--2017-03-15 09:47:38--  https://github.com/martinjvickers/KAST/releases/download/testing_0.0.6/KAST_testing_0.0.6.tar.gz
Resolving github.com (github.com)... 192.30.253.113, 192.30.253.112
Connecting to github.com (github.com)|192.30.253.113|:443... connected.
...
HTTP request sent, awaiting response... 200 OK
Length: 1151139 (1.1M) [application/octet-stream]
Saving to: ‘kast_testing_0.0.6.tar.gz’

100%[======================================>] 1,151,139   1.15MB/s   in 1.0s   

2017-03-15 09:47:41 (1.15 MB/s) - ‘KAST_testing_0.0.6.tar.gz’ saved [1151139/1151139]

martin@desktop:~$ tar xvfz KAST_testing_0.0.6.tar.gz 
kast
martin@desktop:~$ ./kast 
KAST - Alignment-free sequence comparison.
===========================================
    kast -q query.fasta -r reference.fasta -o results.txt [OPTIONS]
    kast -p mydata.fasta -o results.txt [OPTIONS]
    Try 'kast --help' for more information.

VERSION
    Last update: March 2017
    KAST version: 0.0.5
    SeqAn version: 2.2.1

Making KAST accessible in your local environment

When you download KAST you can run it in the directory where you downloaded it from by simply typing ./kast. Note that the ./ is needed. However this has disadvantages as you either have to put all the data you wish to process into that directory or refer to the location of KAST in full.

This can be resolved by adding the kast binary file into a location that your Linux operating system searches for when typing in a command. There are several ways to do this.

Personal home directory install

This is probably the preferred way of installing the KAST binary if you are on a multi-user machine without admin rights or do not wish to install system wide. There are three simple steps;

  • Create a local bin directory in your home directory
  • Move/Copy the kast binary to the bin directory
  • Ensure your Linux environment is search for your local bin directory. (If not, add it to your environment)

e.g.

martin@desktop:~$ mkdir ~/bin
martin@desktop:~$ mv kast ~/bin

At this point, if you can simply type kast and see the following;

martin@desktop:~$ kast
KAST - Alignment-free sequence comparison.
===========================================
    kast -q query.fasta -r reference.fasta -o results.txt [OPTIONS]
    kast -p mydata.fasta -o results.txt [OPTIONS]
    Try 'kast --help' for more information.

VERSION
    Last update: March 2017
    kast version: 0.0.5
    SeqAn version: 2.2.1

all is ready. However if that doesn't work you will need to add the ~/bin directory to your library path. To check your library path, type the following;

martin@desktop:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

To temporarily add your newly created local home binary directory you can use the export command like so;

martin@desktop:~$ export PATH=~/bin:$PATH
martin@desktop:~$ echo $PATH
/home/martin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Notice how /home/martin/bin is now at the front of the list. The ~/ automatically filled in the complete path to your home directory. This will not be permanent though. To do this you can add the export PATH=~/bin:$PATH line to the bottom of your .bashrc file in your home directory.

Using your favourite command line text editor e.g. nano, vi, emacs etc., open the ~/.bashrc file and add export PATH=~/bin:$PATH to the bottom.

With admin rights on a local machine

You can move or copy kast into your /usr/local/bin directory.

martin@desktop:~$ tar xvfz KAST_testing_0.0.6.tar.gz 
kast
martin@desktop:~$ kast
kast: command not found
martin@desktop:~$ sudo mv kast /usr/local/bin/
[sudo] password for martin: 
martin@desktop:~$ kast
kast - Alignment-free sequence comparison.
===========================================
    kast -q query.fasta -r reference.fasta -o results.txt [OPTIONS]
    kast -p mydata.fasta -o results.txt [OPTIONS]
    Try 'kast --help' for more information.

VERSION
    Last update: March 2017
    kast version: 0.0.5
    SeqAn version: 2.2.1

Clone this wiki locally