JBrowse Instructions: How to Install JBrowse

If you want to use JBrowse, you must have administrator rights, otherwise IGV is recommended.

Pre-requirements

Your server must have libpng,zlib,libgd,make,C compiler, C++ compiler installed. There are different installation methods for different operating systems. If you have administrator privileges, you can just use the system’s own management tools.

# Ubuntu/Debian
sudo apt-get install build-essential libpng-dev zlib1g-dev libgd2-xpm-dev
# Red Hat/Fedora/CentOS
sudo yum groupinstall "Development Tools"
sudo yum install libpng-devel gd-devel zlib-devel perl-ExtUtils-MakeMaker
# Mac OS X (homebrew)
## You need to install xcode from the APP Store or by typing gcc at the command line.
xcode-select --install
brew install libpng libgd zlib

Note: If you don’t have administrator privileges, compile it yourself and add it to the environment variables. You may find this very annoying.

Installing jbrowse
There are two ways to install jbrowse:

System level: for more users, often deployed to the web server.
General user level: meets the general needs of intranet users.

System level installation (highest privilege)
System-level installation (requires administrator privileges)

# make a directory that this user can write to
# for ubuntu/Debian that is /var/www/; for centos is /var/www/html
sudo mkdir /var/www/jbrowse;
sudo chown `whoami` /var/www/jbrowse;
# cd into it
cd /var/www/jbrowse;
# fetch a JBrowse release zip file
curl -O http://jbrowse.org/releases/JBrowse-1.12.3/JBrowse-1.12.3.zip
# unzip it and cd into it
unzip JBrowse-1.12.3.zip
cd JBrowse-1.12.3
# run setup.sh, quick start with example data
./setup.sh

System level JBrowse is installed to /var/www, and then you can access the web pages via http://机器IP地址/jbrowse/JBrowse-1.12.3/docs/tutorial/index.html判断安装是否成功.

However, if you don’t have web server software such as “apache” or “nginx” installed on your server, the above operation can’t access the web page successfully.

Therefore, you need to install a web server software and then set up rules so that others can access your local resources without any problem. The one installed here is nginx.

# Install nginx, based on ubuntu
sudo apt-get install nginx
# Check if the installation was successful
sudo nginx -t

Start the nginx service

# Ensure that port 80 is not occupied, otherwise you need to disable the relevant processes
netstat -ano | grep 80
# Start
sudo nginx

Browser access to the IP of the host, e.g. my VM’s IP address is “http://10.10.87.36/”

The above page is stored in /var/www/html/index.nginx-debian.html in the directory directed by /etc/nginx/sites-enabled/default. Where /etc/nginx/sites-enabled/default is a soft link to /etc/nginx/sites-available/default. This is the default setting after the installation of nginx is complete, to provide a case in point. If we need to configure nginx to find the directory where Jbrowse is located, we need to create a configuration file in /etc/nginx/sites-available/ and then link to /etc/nginx/sites-enabled/.

sudo vi /etc/nginx/sites-avaiable/jbrowse
# The content is as follows
Server
    Listening on 8080;
    Listening on [::]:8080;
    root /var/www/jbrowse/JBrowse-1.12.3 ; index index.html
    index index.html
}
# Link to /etc/nginx/sites-enabled/
sudo ln -n /etc/nginx/sites-available/jbrowse /etc/nginx/sites-enabled/jbrowse
# Reboot
ps -ef | grep nginx
sudo kill -QUIT nginx main process number
sudo nginx

Then you realize that you can access JBrowse directly via IP:8080 instead of asking for a long list of addresses like that.

Small-scale use (normal privileges)
Ordinary user level (does not require administrator privileges): Differences from system level, files are stored in the user directory.

# Software raw files, I usually store them in the src folder of my home directory
cd ~/src &curl -O http://jbrowse.org/releases/JBrowse-1.12.3/JBrowse-1.12.3.zip
# Unzip it and move it to my software folder
unzip JBrowse-1.12.3.zip && mv JBrowse-1.12.3 ~/biosoft
# Install
cd ~/biosoft/JBrowse-1.12.3 && . /setup.sh

Ordinary users: nginx and apche is for large access sites, if you just lab content access, just use Python as a web server.

cd ~/biosoft/JBrowse-1.12.3
python -m SimpleHTTPServer 5000
# run for a long time
# nohup python -m SimpleHTTPServer 5000 &

Yes, it’s so simple that you can access “IP:5000” to access the page. But you still need to configure it before you can use it in a real situation!

Summary
In fact, there is not much difference between the two in the installation, installed under /var/www because the document writer defaults to your server already has a web server application, and that application hosted /var/www, and /var/www need certain permissions.

But in reality, if you change the configuration of the web server application, you can install JBrowse anywhere. Even, for a small number of requests, you can just use Python’s own web server to make your JBrowse accessible to outsiders.

Leave a Reply

Your email address will not be published. Required fields are marked *