<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: July 2013]]></title>
	<link>https://bioinformaticsonline.com/blog/group/86/archive/1372654800/1375333200?</link>
	<atom:link href="https://bioinformaticsonline.com/blog/group/86/archive/1372654800/1375333200?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/blog/view/710/how-to-install-perl-modules-manually-using-cpan-command-and-other-quick-ways</guid>
	<pubDate>Fri, 12 Jul 2013 07:20:24 -0500</pubDate>
	<link>https://bioinformaticsonline.com/blog/view/710/how-to-install-perl-modules-manually-using-cpan-command-and-other-quick-ways</link>
	<title><![CDATA[How to install Perl modules manually, using CPAN command, and other quick ways]]></title>
	<description><![CDATA[<p>As a bioinformatics programmer, and crunchy data analyser you need to install several perl modules and dependencies. Installing Perl modules manually by resolving all the dependencies is&nbsp; tedious and annoying process. Some of the packages like GD is the real pain. <br /><br />However, Installing Perl modules using CPAN is a better solution, as it resolves all the dependencies automatically. In this article, let us review how to install Perl modules on Linux ( which is prefereced amonst bioinformatician) using both manual and CPAN method.<br /><br />When a Perl module is not installed, application will display the following error message. In this example, XML::Parser Perl module is missing.</p><p>Can't locate XML/parser.pm in @INC (@INC contains:<br />/usr/lib/perl5/5.10.0/i386-linux-thread-multi<br />/usr/lib/perl5/5.10.0<br />/usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi<br />/usr/local/lib/perl5/site_perl/5.10.0<br />/usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi<br />/usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl<br />/usr/lib/perl5/site_perl/5.10.0 .)</p><p><strong>Manual Method of Perl Module Installation</strong></p><ul>
<li>Install Perl Modules Manually</li>
</ul><p>This manual method is very useful when your computer or server is not connected to the Internet.</p><p>Download Perl module: <br />Go to CPAN Search website and search for the module that you wish to download. In this example, let us search, download and install XML::Parser Perl module. I have downloaded the XML-Parser-2.36.tar.gz to /home/download<br /><br /># cd /home/download<br /># gzip -d XML-Parser-2.36.tar.gz<br /># tar xvf XML-Parser-2.36.tar<br /># cd XML-Parser-2.36<br /><br />Build the perl module: <br />Build by running Makefile.PL, remember the case sensitivity, make and make test.<br /><br /># perl Makefile.PL<br />Checking if your kit is complete...<br />Looks good<br />Writing Makefile for XML::Parser::Expat<br />Writing Makefile for XML::Parser<br /># make<br /># make test<br /><br />Install the perl module:<br />Now your package is ready to install.<br /><br /># make install<br /><br />As a newbie it looks pretty simple, and one go. But, luckily this is a very simple one module with no dependencies. Typically, Perl modules will be dependent on several other modules. Just imagine chasing all these dependencies one-by-one, thinking ... oh ye I got it. That will be very painful and annoying task. I recommend the CPAN method of installation as shown below.</p><p><strong>Install Perl Modules using CPAN automatically</strong></p><p>Logically, you should must have the CPAN perl module installed in your server or computer before you can install any other Perl modules using CPAN. I know you&nbsp; are laughing, "to install a perl module you need another perl module"&nbsp; ;)<br /><br />Lets verify whether CPAN is already installed:<br /><br />To install Perl modules using CPAN, make sure the cpan command is working. Following are the error message when CPAN module is not installed.<br /><br /># cpan<br />-bash: cpan: command not found<br /><br /># perl -MCPAN -e shell<br />Can't locate CPAN.pm in @INC (@INC contains:<br />/usr/lib/perl5/5.10.0/i386-linux-thread-multi<br />/usr/lib/perl5/5.10.0<br />/usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi<br />/usr/local/lib/perl5/site_perl/5.10.0<br />/usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi<br />/usr/lib/perl5/vendor_perl/5.10.0<br />/usr/lib/perl5/vendor_perl /usr/lib/perl5/site_perl/5.10.0 .).<br />BEGIN failed--compilation aborted.<br /><br />Install the CPAN module using yum:<br />If CPAN in not installed in your system, you can use "yum" for the rescue. Dont worry biological data cruncher, this is true we are now dependent all these tiny magicians :). <br /><br /># yum install perl-CPAN<br /><br />Output of yum install perl-CPAN command:</p><p>Loaded plugins: refresh-packagekit<br />updates-newkey&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 2.3 kB&nbsp;&nbsp;&nbsp;&nbsp; 00:00<br />primary.sqlite.bz2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 2.4 MB&nbsp;&nbsp;&nbsp;&nbsp; 00:00<br />Setting up Install Process<br />Parsing package install arguments<br /><br />Resolving Dependencies<br />Transaction Summary<br />=============================================================================<br />Install&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5 Package(s)<br />Update&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 Package(s)<br />Remove&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 Package(s)<br /><br />Total download size: 1.0 M<br />Is this ok [y/N]: y<br />Downloading Packages:<br />(1/5): perl-ExtUtils-ParseXS-2.18-31.fc9.i386.rpm&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 30 kB&nbsp;&nbsp;&nbsp;&nbsp; 00:00<br />(2/5): perl-Test-Harness-2.64-31.fc9.i386.rpm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 70 kB&nbsp;&nbsp;&nbsp;&nbsp; 00:00<br />(3/5): perl-CPAN-1.9205-31.fc9.i386.rpm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 217 kB&nbsp;&nbsp;&nbsp;&nbsp; 00:00<br />(4/5): perl-ExtUtils-MakeMaker-6.36-31.fc9.i386.rpm&nbsp;&nbsp; | 284 kB&nbsp;&nbsp;&nbsp;&nbsp; 00:00<br />(5/5): perl-devel-5.10.0-31.fc9.i386.rpm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 408 kB&nbsp;&nbsp;&nbsp;&nbsp; 00:00<br /><br />Installing&nbsp;&nbsp;&nbsp;&nbsp; : perl-ExtUtils-ParseXS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [1/5]<br />Installing&nbsp;&nbsp;&nbsp;&nbsp; : perl-devel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [2/5]<br />Installing&nbsp;&nbsp;&nbsp;&nbsp; : perl-Test-Harness&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [3/5]<br />Installing&nbsp;&nbsp;&nbsp;&nbsp; : perl-ExtUtils-MakeMaker&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [4/5]<br />Installing&nbsp;&nbsp;&nbsp;&nbsp; : perl-CPAN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [5/5]<br /><br /><br />Installed: perl-CPAN.i386 0:1.9205-31.fc9<br />Dependency Installed:<br />&nbsp; perl-ExtUtils-MakeMaker.i386 0:6.36-31.fc9<br />&nbsp; perl-ExtUtils-ParseXS.i386 1:2.18-31.fc9<br />&nbsp; perl-Test-Harness.i386 0:2.64-31.fc9<br />&nbsp; perl-devel.i386 4:5.10.0-31.fc9<br />Complete!<br /><br />Configure cpan the first time:<br />Once the CPAN is installed, you need to configure it by executing cpan, you should set some configuration parameters as shown below. I have shown only the important configuration parameters below. Accept all the default values by pressing enter.<br /><br />Note: Make sure to execute &ldquo;o conf commit&rdquo; in the cpan prompt after the configuration to save the settings.<br /><br /># cpan<br /><br />Sorry, we have to rerun the configuration dialog for CPAN.pm due<br />to some missing parameters...<br /><br />CPAN build and cache directory? [/root/.cpan]<br />Download target directory? [/root/.cpan/sources]<br />Directory where the build process takes place? [/root/.cpan/build]<br /><br />Always commit changes to config variables to disk? [no]<br />Cache size for build directory (in MB)? [100]<br />Let the index expire after how many days? [1]<br /><br />Perform cache scanning (atstart or never)? [atstart]<br />Cache metadata (yes/no)? [yes]<br />Policy on building prerequisites (follow, ask or ignore)? [ask]<br /><br />Parameters for the 'perl Makefile.PL' command? []<br />Parameters for the 'perl Build.PL' command? []<br /><br />Your ftp_proxy? []<br />Your http_proxy? []<br />Your no_proxy? []<br />Is it OK to try to connect to the Internet? [yes]<br /><br />First, pick a nearby continent and country by typing in the number(s)<br />(1) Africa<br />(2) Asia<br />(3) Central America<br />(4) Europe<br />(5) North America<br />(6) Oceania<br />(7) South America<br />Select your continent (or several nearby continents) [] 5<br /><br />(1) Bahamas<br />(2) Canada<br />(3) Mexico<br />(4) United States<br />Select your country (or several nearby countries) [] 4<br /><br />(2) ftp://carroll.cac.psu.edu/pub/CPAN/<br />(3) ftp://cpan-du.viaverio.com/pub/CPAN/<br />(4) ftp://cpan-sj.viaverio.com/pub/CPAN/<br />(5) ftp://cpan.calvin.edu/pub/CPAN<br />(6) ftp://cpan.cs.utah.edu/pub/CPAN/<br />e.g. '1 4 5' or '7 1-4 8' [] 2-16<br /><br />cpan[1]&gt; o conf commit<br />commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'<br /><br />cpan[2]&gt; quit<br />No history written (no histfile specified).<br />Lockfile removed.<br /><br /></p><ul>
<li>Install Perl Modules using CPAN</li>
</ul><p>Hey smile please, now you are ready with CPAN and can download modules in one line command. <br /><br />You can use one of the following method to install a Perl module using cpan:<br /><br /># perl -MCPAN -e 'install Bundle::BioPerl'<br /><br />(or)<br /><br /># cpan<br />cpan shell -- CPAN exploration and modules installation (v1.9205)<br />ReadLine support available (maybe install Bundle::CPAN or Bundle::CPANxxl?)<br /><br />cpan[1]&gt; install "Bundle::BioPerl"<br /><br />In the example above, CPAN will check for&nbsp;Bundle::BioPerl dependencies and automatically resolves and installs&nbsp;Bundle::BioPerl with all the dependent Perl modules.</p><ul>
<li>Quick Ways</li>
</ul><p>Oh, look at your face.. smily hmm :). This is what your are looking for, a quick and best way to install Perl modules, Bioperl. Following are the the steps to download BioPerl in your server/computer.</p><p># sudo apt-cache search perl BioPerl</p><p>Output will be like as follows:</p><p>bioperl - Perl tools for computational molecular biology<br />bioperl-run - BioPerl wrappers: scripts<br />libbio-perl-perl - BioPerl core perl modules<br />libbio-perl-run-perl - BioPerl wrappers: modules<br />libbio-samtools-perl - Perl interface to SamTools library for DNA sequencing<br />libbiojava-java - Java API to biological data and applications (default version)<br />libbiojava3-java - Java API to biological data and applications (default version)<br />python-biopython-sql - Biopython support for the BioSQL database schema<br />libbtlib-perl - library for basic sequence manipulation<br /><br /></p><p># sudo apt-get install bioperl</p><p>If it is installed then flash the following message:</p><p>Reading package lists... Done<br />Building dependency tree&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />Reading state information... Done<br />bioperl is already the newest version.<br />0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.</p><p>In it is found not installed in your server or system them install all with dependencies.</p><p>You can use the same approach to install all the modules, and packages if required.</p><p>Thanks for reading. Best of luck for your research.</p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>

</channel>
</rss>