1 Installation of Perl and Bioperl with Modules for Mysql Databases
Total Page:16
File Type:pdf, Size:1020Kb
Perl Installation Bioinformatics II - Tools for Functional Genomics Installation of Perl and BioPerl with modules for MySQL databases (Windows XP) 1. Installation of ActiveState Perl 1 2. Installation of Perl modules and BioPerl 2 3. Executing Perl scripts 5 4. Installation of the programming editor Proton 7 5. Installation of the programming editor Komodo Edit 8 1. Installation of ActiveState Perl Perl is a script programming language often used for bioinformatics solutions. There are many modules available at the Perl script archive CPAN. A special BioPerl project provides extended functions for bioinformatics. The well-established Windows version provided by ActiveState is ActivePerl 5.8.8.822. The new Perl branch 5.10 was launched recently and the newest ActiveState Perl version published is now 5.10.0.1003. This version is one of the first of the 5.10 developmental branch, it may have some yet undiscovered problems. Some BioPerl libraries originally did not work with the 5.10 version, however, most problems are now solved and the BioPerl community has now published a new guide for the Perl 5.10 series and we suggest therefore using the newest Perl branch. Binaries for Perl 5.10 are available for installation. http://www.activestate.com/Products/ActivePerl/ Download procedure: - Visit the download site: http://www.activestate.com/downloads/ - Choose at the right panel "Language Downloads" → "ActivePerl". - On the next page select at the "Choose from" tab the "Download" button for ("ActivePerl"). - If you want to receive e-mail informations from ActiveState report your details on the next page, else click on the "Continue" button. - On the next page select the required Perl package for download. For a standard Windows distribution we suggest to use the "Windows(x86)" "MSI" package of "ActivePerl 5.8.8.822" (status of December, 19th, 2007): ActivePerl-5.8.8.822-MSWin32-x86-280952.msi 16 221 KB "ActivePerl 5.10.0.1003" (status July, 17th, 2008): ActivePerl-5.10.0.1003-MSWin32-x86-285500.msi (status July, 17th, 2008). Perl Installation Jul-2008 1 Perl Installation Bioinformatics II - Tools for Functional Genomics Warning: It is a good idea to remove any previous Perl installation, before installation of a new ActiveState Perl version. Delete also all previous installed packages (e.g. directory /Perl/site), since deinstallation of the main program will not touch preinstalled packages at the /site subdirectory. Be aware that packages of the 5.10 series are not binary compatible with packages of the 5.8 series and vice versa. If you update to the 5.10 series from 5.8 please update also all previous installed packages. The installation should be done using administrator rights. ActivePerl-5.10.0.1003-MSWin32-x86-285500.msi During installation we suggest to change the preset folder from C:\Perl to C:\Program Files\Perl and to register the Perl program folder in the system path. This allows Windows to start Perl scripts ending with ".pl" by double clicking on them. Check the correct entry in the Windows PATH environment variable: Add at Control Panel → System → Advanced → lower tab Environment variables → lower window system variable “Path” → "Edit" Add at end of line a semicolon “;” and “C:\Program Files\Perl\bin” and additionally at end of line “;” and “C:\Program Files\Perl\site\bin” and → click OK and restart the PC. Hint: The installation program may have added these directories to the path already, but check for any double entries of older versions and remove them. The local Perl Help files are best viewed using your favourite web browser by loading the local index file: file:///C:/Program Files/Perl/html/index.html 2. Installation of Perl modules and BioPerl To use MySQL and BioPerl additional modules have to be installed. These Perl modules (packages) can be downloaded from the module archive CPAN. For Windows Perl, the Active State module repository should be used. Some of the modules (like DBD-mysql or the BioPerl packages) are not provided by ActiveState and may be installed from alternative repositories: A help file for a installed specific module can be reached from the Perl Help files main window, scrolling down the left panel to the module section: (C:\Program Files\Perl\html\index.html). Some modules have a documentation called from the cmd window by entering Perl Installation Jul-2008 2 Perl Installation Bioinformatics II - Tools for Functional Genomics "perldoc module" e.g. module "perldoc cwd" to read the documentation of the package "cwd" allowing to read the current directory. You can enlarge the cmd window vertically using your mouse, clicking at the upper or lower window border and pulling it up or down. The module documentation is listed page for page. Pressing "Enter" will show the next line, pressing the "space" tab the next page. For communication wit a MySQL database four additional modules are needed: DB_File the Berkeley database management module (DBD) DBI the common database interface Data-Table the database table handling routines DBD-mysql the MySQL-driver for trhe DBD database system The ActiveState Repository does not hold the newest version of BioPerl. We suggest to use the new 1.5.2 distribution provided by the BioPerl community. Some BioPerl programs may not work with the 5.10 Perl branch (e.g. Bio::SeqIO::entrezgene). This may be updated soon and we suggest to use already the 5.10 branch. Prerequisite: for ActiveState at least Perl version >= 5.8.8.819. A new BioPerl Wiki for installation on Windows guides through the installation process: http://www.bioperl.org/wiki/Installing_Bioperl_on_Windows Module installation procedure using ppm: Run the module installation tool Perl package manager ppm: → "Start" → "Run" → "cmd" → "ppm" # Starts the Perl package manager ppm uses a convenient graphical interface in the newest Perl versions. Configuration of additional repositories: Select at the main menu item "Edit" → "Preferences" → tab "Repositories" Copy "Name:" and "Location:" (internet link) into the respective entry fields. Do not change "Suggested:" "Install PPM-Repositories". Click on "Add" button to activate them. For the Perl 5.8 branch: Name Location BioPerl-Regular Releases http://bioperl.org/DIST Kobes http://theoryx5.uwinnipeg.ca/ppms Perl Installation Jul-2008 3 Perl Installation Bioinformatics II - Tools for Functional Genomics Bribes http://www.Bribes.org/perl/ppm For the Perl 5.10 branch: Name Location BioPerl-Regular Releases http://bioperl.org/DIST Kobes http://cpan.uwinnipeg.ca/PPMPackages/10xx/ Bribes http://www.Bribes.org/perl/ppm Trouchelle http://trouchelle.com/ppm10/package.xml Select at the menu item “View” → “All Packages”. Enter at the "magnifying glass symbol" entry field the module names, select them, and start the installation by selecting menu item → Action → Install. Current suggested modules are: MySQL database support: DB_File v 1.816 DBI v 1.604 (preinstalled at Perl 5.10) DBD-mysql v 4.005 (for 5.10 Kobes repository) Data-Table v 1.54 BioPerl (BioPerl, Kobes and Bribes repositories) bioperl v 1.5.2_100 BioPerl package bioperl-db v 1.5.2_100 BioPerl database packages bioperl-network v 1.5.2_100 BioPerl pathway packages bioperl-run v 1.5.2_100 BioPerl application packages Only for Perl 5.8 series (not recommended): bioperl v 1.2.3 BioPerl bioperl-gui v 0.7 BioPerl graphical user interface Graphics support GD v 2.39 (preinstalled in Perl 5.10.1003) Support for graphical user interfaces (GUI) and Windows system calls Win32-API v 0.55 (not preinstalled in Perl 5.8) Win32-GUI v 1.06 Tk v 804.028 (not preinstalled in Perl 5.10) Excel Spreadsheet support Spreadsheet-ParseExcel v0.32 Perl Excel file reader Perl Installation Jul-2008 4 Perl Installation Bioinformatics II - Tools for Functional Genomics Spreadsheet-ParseExcel-Simple v1.04 Perl Excel file reader Spreadsheet-ParseExcel_XHTML v1.04 Perl Excel XHTML file reader Spreadsheet-WriteExcel v2.21 Perl Excel file writer (for 5.10 Trouchelle) SOAP protocol support for internet connection to SOAP services SOAP-Lite v 0.69 Web service package You can always visit, verify and update module installations using ppm. Checking the installed version of BioPerl A version number can be called by a "one-liner", a Perl command which is typed or copied into one line of the Windows cmd terminal: The Linux version is found at the BioPerl FAQ internet page: http://www.bioperl.org/wiki/FAQ#How_can_I_tell_what_version_of_BioPerl_is_installed.3F perl -MBio::Root::Version -e 'print $Bio::Root::Version::VERSION,"\n"' For the Windows cmd terminal the single quotes enclosing the red labelled executable command must be changed to double quotes ' → ", and the double quotes around the line break symbol "\n" must be escaped by back slashes: \"\n\". The modified one-liner for Windows reads: perl -MBio::Root::Version -e "print $Bio::Root::Version::VERSION,\"\n\"" Click on the "Start" tab of the Windows main window, select the "Run" option and type "cmd" in the prompted entry field. In the cmd window right-click onto the "C:\"- symbol in the left upper corner of the window and select the menu item "Edit" → "Paste" and insert the one-liner modified for Windows and press "Enter". The Perl interpreter should return the installed BioPerl version: "1.0050021" (= version 1.5.21). The subversions are separated by several zeros (00). 3. Executing Perl scripts Run a script by double clicking on it: A convenient way is to start a Perl script by double clicking on its file using Windows Explorer. It should be shown with a gecko symbol and has always the ending ".pl". You can also make a desktop link to a script, you may use often. This will allow the script to ask for programmed parameters, run the script job and close again the script window.