Skip to content


Martin Asser Hansen edited this page May 29, 2020 · 13 revisions
Clone this wiki locally

Installing Biopieces

Before you install Biopieces you need a number of prerequisites in order for the Biopieces to work. Biopieces will only work on systems with a UNIX flavor. So far Biopieces have been tested successfully on MacOSX, Redhat/Linux, Ubuntu/Linux - so no Microsoft Windows - unless using Cygwin.


  1. Make sure Perl and required Perl modules are installed
  2. Make sure that Ruby and required Ruby gems are installed
  3. Make sure that Python is installed
  4. Install external tools
  5. Checkout Biopieces code from repository
  6. Checkout Biopieces wiki pages from repository
  7. Configure Biopieces
  8. Create required directories
  9. Run tests.


The basic idea behind Biopieces is that they should work no matter the programming language. For now Biopieces are written in Perl, Ruby and Python.


Currently most Biopieces are written in Perl, and the framework is written in Perl, so Perl and a number of Perl modules are mandatory. You will need Perl version 5.8 or later.

You also need the below list of Perl modules. To check if you already have one of the modules you type perl -M<module name> on the command line and Perl will raise an error if the module was not found. To install modules try the following on the command line (you may need admin rights if you are installing modules on the system Perl - in which case you need to prefix with sudo):

$ cpan
cpan> install <module>
cpan> install <another modules>

etc ...

cpan> q
  • JSON::XS
  • Module::Build
  • Bit::Vector
  • SVG
  • Term::ReadKey
  • Time::HiRes
  • DBI
  • XML::Parser
  • Carp::Clan
  • Class::Inspector
  • HTML::Parser
  • LWP
  • SOAP::Lite
  • URI
  • Inline
  • Inline::C
  • Parse::RecDescent
  • version
  • DB_File
  • DBD::mysql


An increasing number of Biopieces are written in Ruby and Ruby 1.9 or later is required.

You also need the below list of Ruby gems:

  • gnuplot
  • narray
  • RubyInline
  • terminal-table

Ruby gems are installed simply by typing on the command line (if you use the system's Ruby you need admin rights, so prefix with sudo):

gem install <gem name>


For now, only a few Biopieces are written in Python, but there will be more. Python 2.6 or later is required.

External Tools

A number of Biopieces depends on external tools in order to work, and these tools you have to install yourself if you want to use them (unless they are already on your system).

After installation the location of the binaries should be added to the PATH environment variable.

Installing Biopieces from Github

Go to the directory where you want to install Biopieces and do:

git clone --recursive

Configuring Biopieces

Add the following section to your ~/.bashrc file and run source ~/.bashrc in order to enable biopieces in a bash environment. Other shells are currently not supported.

# >>>>>>>>>>>>>>>>>>>>>>> Enabling Biopieces if installed <<<<<<<<<<<<<<<<<<<<<<<

# Modify the below paths according to your settings.

export BP_DIR="$HOME/biopieces"  # Directory where biopieces are installed
export BP_DATA="$HOME/BP_DATA"   # Contains genomic data etc.
export BP_TMP="$HOME/tmp"        # Required temporary directory.
export BP_LOG="$HOME/BP_LOG"     # Required log directory.

if [ -f "$BP_DIR/config/bashrc" ]; then
    source "$BP_DIR/config/bashrc"

# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Creating Directories

You need to create the directories $BP_DATA, $BP_TMP, and $BP_LOG if these don't exist already:


Testing Biopieces

Run the Biopieces testing suite using the following command:


If the testing suite breaks and will not run you are probably missing some of the Perl modules mentioned in the prerequisites. If the tests do run and any of them are failing, you probably are missing some of the [external tools] such as BLAST - running bp_test should indicate these as warnings. Otherwise do report problems.

All done!

For important messages, questions, discussion, and suggestions join the Biopieces Google Group.

Once your installation works you might want to head over to the [Biopieces Introduction] for examples on how to get started analyzing data.