# Installation

VISOR (opens new window) is written in python 3. It requires a working python 3 environment on a unix machine in order to be installed from source and run properly. VISOR (opens new window) is also available as a Docker container (opens new window).


	 ___      ___ ___  ________  ________  ________     
	|\  \    /  /|\  \|\   ____\|\   __  \|\   __  \    
	\ \  \  /  / | \  \ \  \___|\ \  \|\  \ \  \|\  \   
	 \ \  \/  / / \ \  \ \_____  \ \  \\\  \ \   _  _\  
	  \ \    / /   \ \  \|____|\  \ \  \\\  \ \  \\  \| 
	   \ \__/ /     \ \__\____\_\  \ \_______\ \__\\ _\ 
	    \|__|/       \|__|\_________\|_______|\|__|\|__| v 1.1
	                     \|_________|                   

# Installation from source

A python 3 environment can be created using Anaconda (opens new window) and its minimal installer Miniconda (opens new window). For a Linux distribution, for instance:

apt-get update && apt-get install -y curl git build-essential g++ cmake libz-dev libcurl4-openssl-dev libssl-dev libbz2-dev liblzma-dev libncurses5-dev
curl -LO https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
cd ~ && source .bashrc
conda update -y conda
conda create -y -n visorenv python=3.8

As from v1.1, VISOR requires bedtools (as this is required by pybedtools), minimap2 and samtools in PATH. These can be installed from source or through the bioconda channel of miniconda. When installing all through miniconda, be sure to install samtools/htslib >= 1.9 and minimap2 >= 2.17. An example of installation is given below.

#get htslib
curl -LO https://github.com/samtools/htslib/releases/download/1.11/htslib-1.11.tar.bz2 && tar -vxjf htslib-1.11.tar.bz2 && cd htslib-1.11 && make && sudo make install && cd ..
#get samtools
curl -LO https://github.com/samtools/samtools/releases/download/1.11/samtools-1.11.tar.bz2 && tar -vxjf samtools-1.11.tar.bz2 && cd samtools-1.11 && make && sudo make install && cd ..
#get minimap2
git clone https://github.com/lh3/minimap2.git && cd minimap2 && make && sudo make install && cd ..
#get bedtools
conda install -y -n visorenv -c bioconda bedtools

VISOR (opens new window) can then be cloned and installed.

conda activate visorenv
#if not available already, also pip install --upgrade cython
git clone https://github.com/davidebolo1993/VISOR.git
cd VISOR
pip install -r requirements.txt
python setup.py install
VISOR --help

# Docker container

For Docker (opens new window) users, VISOR (opens new window) is also available as a Docker container (opens new window). One can pull the image and run this as below.

#will require sudo privileges, probably
docker pull davidebolo1993/visor
docker run davidebolo1993/visor VISOR --help
#or using an interactive tty to the docker container
docker run -ti davidebolo1993/visor 
#$(visorenv) VISOR --help