Perl
Many of the build processes are carried out by Perl programs. You will need Perl installed on your system to build or maintain an InterMine installation. Linux and MacOS systems will have a suitable Perl already installed. Perl is available for Windows, but is not actively supported by InterMine.
To set up your Perl environment, perlbrew is a good guide, and make use of the modern toolchain, like cpan.
At various times, you will be requested to install various Perl modules. Here, you can find instructions for how to do this using the native CPAN tool which comes with every Perl distribution on Linux and OSX, using Debian/Ubuntu package managers, as well as manual installs:
#
CPANCPAN stands for the Comprehensive Perl Archive Network and it is the software repository for Perl modules (you can compare it to python's pypi, Yum/Apt repositories in Linux, or Apple's App Store). If you have Perl installed, you have CPAN. To check, type cpan
in a terminal.
To install modules with CPAN you may first need to set up the installer, in a terminal run:
This will take you to a CPAN shell, which will allow you to configure your properties. To review your current configuration, type:
When you first run CPAN should run:
This will guide you through the set-up procedure. You can run this later to change the settings which are set automatically.
To change a setting manually, type:
For example, to make installed modules uninstall previous versions and use sudo to elevate permissions (very good ideas), type:
If you change options, remember to save your changes with:
To install modules, type:
To force the install for any reason, use the "-f" flag, so type:
If you have not set the sudo option in the CPAN configuration, Add sudo before the CPAN command, like:
#
DEB PackagesMany Perl libraries are packaged for different Linux distributions. Debian/Ubuntu has a great number of these, and in many cases this is a good alternative to the CPAN install.
The procedure to install is the same as for any other package:
There is a predictable name to package mapping: "::" becomes "-", there will be a "lib" on the front, and a "-perl" on the end, so:
- "
XML::DOM
" becomes "libxml-dom-perl
" - "
Moose
" becomes "libmoose-perl
" - and so on
These are the modules you need to build a database:
To search for a package, you can type:
#
Manually installing InterMine modulesThe InterMine Perl modules are available on CPAN, and you are encouraged to download them from there. However, you can install them manually too. First you will need to check-out the source code. (It is recommended you update your version of Module::Build to at least version 0.36, as this will allow you to automate the dependency installation.)
From your check out (or unzipped tar file) go to the directory "intermine/perl/
"
Here, there are three "distributions" of modules you may want to install:
- InterMine-Model
- InterMine-Item (depends on InterMine::Model)
- Webservice-InterMine (depends on InterMine::Model)
The installation procedure for these is the same:
If you do not have Module::Build 0.36 or above, you can install the dependencies using the above methods (CPAN and Packages).
#
List of Perl Modules to Install- For the InterMine modules:
List::MoreUtils
(utility functions for handling lists)LWP
(Handling network communication)Module::Find
(Automatically locating modules by name)Moose
(Object system)MooseX::Role::WithOverloading
(Allows roles to overload operators)MooseX::Types
(Type constraint system)Text::CSV_XS
(Processing .csv and .tsv files)URI
(Handling URLs)XML::Parser::PerlSAX
(Parsing XML)XML::DOM
(XML processing and output)Text::Glob
(used by theproject_build
script)
- For the download scripts:
- Log::Handler
- DateTime
- Module::Find
- Web::Scraper
- Ouch
- Number::Format
- PerlIO::gzip
- Perl6::Junction
- For generating InterMine Items XML:
- Getopt::Std
- Log::Handler;
- Digest::MD5
#
How to install all the Perl Modules to Run the Data Downloader ScriptIn order to download all the Perl scripts required by the Data Downloader script, use the following cpan installation command: