Install Perl Modules

Click here to go back to the identity Installation page.

Perl modules add new functions to perl including the ability to read BAM files (Bio::DB::Sam) and to perform multi-threading (Parallel::ForkManager). Perl modules are hosted at CPAN which allows automated installing, including nay necessary perl dependencies. CPAN usually requires 'sudo' which requires root access, however a perl module called local::lib allows them to be installed without root access.

Installing local::lib

local::lib enables perl module installation with root access. It can be installed and added to the path using these commands:

wget -O- http://cpanmin.us | perl - -l ~/perl5 App::cpanminus local::lib
eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bashrc
source ~/.bashrc

NB: If you are installing on a Mac then you will need to use '~/.profile' instead of '~/.bashrc'.

Testing local::lib

To check that local::lib has been installed correctly install this simple module and check the time on the east coast according to where the clock hands are:

cpanm Acme::Time::Baby
perl -MAcme::Time::Baby -E 'say babytime'

Installing Parallel::ForkManager

This module allows multi-threading. Full details can be seen here. To install it use this command:

cpanm Parallel::ForkManager

Installing Bio::DB::Sam

This module allows BAM files to be read and edited. Full details can be seen here. It requires many dependencies so it takes about 60-90min to install during which you may need to hit return many times to give it permission to proceed. Before starting the install you need to know where samtools is installed (see Install Samtools if it is not). To find out use this command and copy the output:

which samtools

To install Bio::DB::Sam use this command, pasting in the Samtools install location when prompted near the start:

cpanm Bio::DB::Sam
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License