first pass at xmfa parser (next_aln() implemented only)
[bioperl-live.git] / INSTALL
blobfb0f20892c48dc46d496d81268411608ff5e9644
1 # $Id$
3                           Installing Bioperl for Unix
5      *  BIOPERL INSTALLATION
6      *  SYSTEM REQUIREMENTS
7      *  OPTIONAL
8      *  ADDITIONAL INSTALLATION INFORMATION
9      *  THE BIOPERL BUNDLE
10      *  INSTALLING BIOPERL THE EASY WAY USING CPAN
11      *  INSTALLING BIOPERL THE EASY WAY USING GNU 'make'
12      *  WHERE ARE THE MAN PAGES?
13      *  EXTERNAL PROGRAMS
14           *  Environment Variables
15      *  INSTALLING BIOPERL SCRIPTS
16      *  INSTALLING BIOPERL IN A PERSONAL MODULE AREA
17      *  INSTALLING BIOPERL MODULES THE HARD WAY
18      *  USING MODULES NOT INSTALLED IN THE STANDARD LOCATION
19      *  THE TEST SYSTEM
20      *  BUILDING THE OPTIONAL bioperl-ext PACKAGE
21           *  CONFIGURING for BSD and Solaris boxes
22           *  INSTALLATION
23      *  DEPENDENCIES AND Bundle::BioPerl
24      *  Notes
26 BIOPERL INSTALLATION
28 Bioperl has been installed on many forms of Unix,
29 Win9X/NT/2000/XP, and on Mac OS X (see the PLATFORMS file for more
30 details). Following are instructions for installing Bioperl for
31 Unix/Linux/Mac OS X; Windows installation instructions can be found
32 in INSTALL.WIN. For installing Bioperl for Mac OS X using Fink, see:
34 http://www.bioperl.org/wiki/Getting_BioPerl#Mac_OS_X_using_fink
36 SYSTEM REQUIREMENTS
38     * Perl 5.6.1 or later; version 5.8 and greater are recommended.
40     * External modules: Bioperl uses functionality provided in other
41       Perl modules. Some of these are included in the standard perl package
42       but some need to be obtained from the CPAN site. The list of external
43       modules is included at the bottom of this document.
45 The CPAN Bioperl Bundle (Bundle::BioPerl) makes installation of these
46 external modules easy. Simply install the bundle using your CPAN shell and
47 all necessary modules will be installed. See THE BIOPERL BUNDLE,
48 below.
50 OPTIONAL
52    * ANSI C or GNU C compiler (gcc) for XS extensions (the
53      bioperl-ext package; see BUILDING THE OPTIONAL bioperl-ext
54      PACKAGE, below).
56 ADDITIONAL INSTALLATION INFORMATION
58    * Additional information on Bioperl and MAC OS:
59       * OS 9 - http://bioperl.org/Core/mac-bioperl.html
60       * OS X - http://www.tc.umn.edu/~cann0010/Bioperl_OSX_install.html
61       * OS X - Installing using Fink (in Getting BioPerl)
63 THE BIOPERL BUNDLE
65 You typically need root privileges to install using CPAN. If you don't
66 have these privileges please see INSTALLING BIOPERL IN A PERSONAL
67 MODULE AREA for additional information.
69 Install Bundle::Bioperl using CPAN. One way:
71  >perl -MCPAN -e "install Bundle::BioPerl"
73 Another way:
75  >perl -MCPAN -e shell
76  cpan>install Bundle::BioPerl
79 INSTALLING BIOPERL THE EASY WAY USING CPAN
81 You can use the CPAN shell to install Bioperl. For example:
83  >perl -MCPAN -e shell
85 Then find the name of the Bioperl version you want:
87  cpan>d /bioperl/
88  CPAN: Storable loaded ok
89  Going to read /home/bosborne/.cpan/Metadata
90  Database was generated on Tue, 24 Feb 2004 23:55:23 GMT
91  DistributionB/BI/BIRNEY/bioperl-1.2.tar.gz
92  DistributionB/BI/BIRNEY/bioperl-1.4.tar.gz
94 Now install:
96  cpan>install B/BI/BIRNEY/bioperl-1.4.tar.gz
98 If you've installed everything perfectly and all the network connections
99 are working then you may pass all the tests run in the 'make test' phase.
100 It's also possible that you may fail some tests. Possible explanations:
101 problems with local Perl installation, network problems, previously
102 undetected bug in Bioperl, flawed test script, problems with CGI
103 script used for sequence retrieval at public database, and so on. Remember
104 that there are over 700 modules in Bioperl and the test suite is running
105 more than 9000 individual tests, a few failed tests may not affect your
106 usage of Bioperl.
108 If you decide that the failed tests will not affect how you intend to use
109 Bioperl and you'd like to install anyway do:
111  cpan>force install B/BI/BIRNEY/bioperl-1.4.tar.gz
113 This is what most experienced Bioperl users would do. However, if you're
114 concerned about a failed test and need assistance or advice then contact
115 bioperl-l@bioperl.org.
117 INSTALLING BIOPERL THE EASY WAY USING GNU 'make'
119 The advantage of this approach is it's stepwise, so it's easy to stop and
120 analyze in case of any problem.
122 Download, then unpack the tar file. For example:
124  >gunzip bioperl-1.2.tar.gz
125  >tar xvf bioperl-1.2.tar
126  >cd bioperl-1.2
128 Now issue the make commands:
130  >perl Makefile.PL
131  >make
132  >make test
134 If you've installed everything perfectly and all the network connections
135 are working then you may pass all the tests run in the 'make test' phase.
136 It's also possible that you may fail some tests. Possible explanations:
137 problems with local Perl installation, network problems, previously
138 undetected bug in Bioperl, flawed test script, problems with CGI script
139 using for sequence retrieval at public database, and so on. Remember that
140 there are over 700 modules in Bioperl and the test suite is running almost
141 9000 individual tests, a few failed tests may not affect your usage of
142 Bioperl.
144 If you decide that the failed tests will not affect how you intend to use
145 Bioperl and you'd like to install anyway do:
147  >make install
149 This is what most experienced Bioperl users would do. However, if you're
150 concerned about a failed test and need assistance or advice then contact
151 bioperl-l@bioperl.org.
153 To 'make install' you need write permission in the perl5/site_perl/source
154 area. Usually this will require you becoming root, so you will want to
155 talk to your systems manager if you don't have the necessary privileges.
157 It is also straightforward to install the package outside of the this
158 standard Perl5 location. See INSTALLING BIOPERL IN A PERSONAL MODULE
159 AREA, below.
161 WHERE ARE THE MAN PAGES?
163 We had to disable the automatic creation of man pages because this
164 step was triggering a "line too long" error on some OSs due to shell
165 constraints. If you'd like to try and create them comment out or delete
166 the MY::manifypods subroutine in Makefile.PL before you issue the 'perl
167 Makefile.PL' step.   
169 EXTERNAL PROGRAMS
171 Bioperl can interface with some external programs for executing analyses.
172 These include clustalw and t_coffee for Multiple Sequence Alignment
173 (Bio::Tools::Run::Alignment::Clustalw and
174 Bio::Tools::Run::Alignment::TCoffee) and blastall, blastpgp, and
175 bl2seq for BLAST analyses (Bio::Tools::Run::StandAloneBlast), and
176 to all the programs in the EMBOSS suite (Bio::Factory::EMBOSS).
178     Environment Variables
180 Some modules which run external programs need certain environment
181 variables set. If you do not have a local copy of the specific executable
182 you do not need to set these variables. Additionally the modules will
183 attempt to locate the specific applications in your runtime PATH variable.
184 You may also need to set an environment variable to tell BioPerl about
185 your network configuration if your site uses a firewall.
187 Setting environment variables on unix means adding lines like the
188 following to your shell *rc file.
190    For bash or sh:
192  export BLASTDIR=/data1/blast
194    For csh or tcsh:
196  setenv BLASTDIR /data1/blast
198 Some environment variables include:
200 +------------------------------------------------------------------------+
201 | Env. Variable |                      Description                       |
202 |---------------+--------------------------------------------------------|
203 |               |Specifies where the NCBI blastall, blastpgp, bl2seq,    |
204 |BLASTDIR       |etc.. are located. A 'data' directory could also be     |
205 |               |present in this directory as well, you could put your   |
206 |               |blastable databases here.                               |
207 |---------------+--------------------------------------------------------|
208 |               |If one does not want to locate the data dir within the  |
209 |BLASTDATADIR or|same dir as where the BLASTDIR variable points, a       |
210 |BLASTDB        |BLASTDATADIR or BLASTDB variable can be set to point to |
211 |               |a dir where BLAST database indexes are located.         |
212 |---------------+--------------------------------------------------------|
213 |BLASTMAT       |The directory containing the substitution matrices such |
214 |               |as BLOSUM62.                                            |
215 |---------------+--------------------------------------------------------|
216 |CLUSTALDIR     |The directory where the clustalw executable is located. |
217 |---------------+--------------------------------------------------------|
218 |TCOFFEEDIR     |The directory where the t_coffee executable is located. |
219 |---------------+--------------------------------------------------------|
220 |               |If you access the internet via a proxy server then you  |
221 |               |can tell the Bioperl modules which require network      |
222 |               |access about this by using the http_proxy environment   |
223 |http_proxy     |variable. The value set includes the proxy address and  |
224 |               |the port, with optional username/password for           |
225 |               |authentication purposes                                 |
226 |               |(e.g. http://USERNAME:PASSWORD@proxy.example.com:8080). |
227 +------------------------------------------------------------------------+
229 INSTALLING BIOPERL SCRIPTS
231 Bioperl comes with a set of production-quality scripts that are
232 kept in the scripts/ directory. You can install these scripts if you'd
233 like, simply answer the questions on 'make install'. The installation
234 directory is specified by the INSTALLSCRIPT variable in the Makefile, the
235 default location is /usr/bin. Installation will copy the scripts to the
236 specified directory, change the 'PLS' suffix to 'pl', and prepend 'bp_' to
237 all the script names if they aren't so named already.
239 INSTALLING BIOPERL IN A PERSONAL MODULE AREA
241 If you lack permission to install perl modules into the standard
242 site_perl/ system area you can configure Bioperl to install itself
243 anywhere you choose. Ideally this would be a personal perl directory or
244 standard place where you plan to put all your 'local' or personal perl
245 modules.
247 Simply pass a parameter to perl as it builds your system specific
248 makefile.
250    Example:
252  >perl Makefile.PL  LIB=/home/users/dag/My_Local_Perl_Modules
253  >make
254  >make test
255  >make install
257 This tells perl to install bioperl in the desired place, e.g.:
259    /home/users/dag/My_Local_Perl_Modules/Bio/Seq.pm
261 Then in your Bioperl script you would write:
263  use lib "/home/users/dag/My_Local_Perl_Modules";
264  use Bio::Seq;
266 The man pages will probably be installed in $LIB/man. For more information
267 on these sorts of custom installs see the documentation for
268 ExtUtils::MakeMaker.
270 You can also use CPAN to install accessory modules in your local
271 directory. First enter the CPAN shell, then set the arguments for the
272 command "perl Makefile.PL", like this:
274  >perl -e shell -MCPAN
275  cpan>o conf makepl_arg LIB=/home/users/dag/My_Local_Perl_Modules
277 INSTALLING BIOPERL MODULES THE HARD WAY
279 As a last resort, you can simply copy all files in Bio/ to any directory
280 in which you have write privileges. This is generally NOT recommended
281 since some modules may require special configuration (currently none do,
282 but don't rely on this).
284 You will need to set "use lib '/path/to/my/bioperl/modules';" in your perl
285 scripts so that you can access these modules if they are not installed in
286 the standard site_perl/ location. See above for an example.
288 To get manpage documentation to work correctly you will have to
289 configure man so that it looks in the proper directory. On most systems
290 this will just involve adding an additional directory to your $MANPATH
291 environment variable.
293 The installation of the Compile directory can be similarly redirected, but
294 execute the make commands from the Compile/SW directory.
296 If all else fails or are unable to access the perl distribution
297 directories, ask your system administrator to place the files there for
298 you. You can always execute perl scripts in the same directory as the
299 location of the modules (Bio/ in the distribution) since perl always
300 checks the current working directory when looking for modules.
302 USING MODULES NOT INSTALLED IN THE STANDARD LOCATION
304 You can explicitly tell perl where to look for modules by using the
305 Lib module which comes standard with perl.
307    Example:
309  #!/usr/bin/perl
310  use lib "/home/users/dag/My_Local_Perl_Modules/";
311  use Bio::Seq;
312  #<...insert whizzy perl code here...>
314 Or, you can set the environmental variable PERL5LIB:
316    csh or tcsh:
318  setenv PERL5LIB /home/users/dag/My_Local_Perl_Modules/
320    bash or sh:
322  export PERL5LIB=/home/users/dag/My_Local_Perl_Modules/
324 THE TEST SYSTEM
326 The Bioperl test system is located in the t/ directory and is
327 automatically run whenever you execute the 'make test' command.
328 Alternatively if you want to investigate the behavior of a specific test
329 such as the SeqIO test you would type:
331  >perl -I. -w t/SeqIO.t
333 The -I. tells Perl to use the current directory as the include path - this
334 makes sure you are testing the modules in this directory not ones
335 installed elsewhere in your PERL5LIB path. The -w tells Perl to print all
336 warnings.
338 If you are trying to learn how to use a module, often the test suite is a
339 good place to look. All good extreme programmers try and write a test
340 BEFORE they write the module to insure that their module behaves the way
341 they expect. You'll notice some 'ok' and 'skip' commands in a test, this
342 is part of the Perl test suite that signifies a passed test with an 'ok
343 N', where N is the test number. Alternatively you can tell Perl to skip
344 tests. This is useful when, for example, your test detects that the
345 network is not present and thus should skip, not fail, any tests that
346 require a network connection.
348 BUILDING THE OPTIONAL bioperl-ext PACKAGE
350 The bioperl-ext package contains C code and XS extensions for
351 various alignment and trace file modules (Bio::Tools::pSW for DNA
352 Smith-Waterman, Bio::Tools::dpAlign for protein Smith-Waterman,
353 Bio::SearchDist for EVD fitting of extreme value,
354 Bio::SeqIO::staden).
356 This Installation works out-of-the box for all platforms except BSD
357 and Solaris boxes. For other platforms skip this next paragraph.
359     CONFIGURING for BSD and Solaris boxes
361 You should add the line -fPIC to the CFLAGS line in
362 Compile/SW/libs/makefile. This makes the compile generate position
363 independent code, which is required for these architectures. In addition,
364 on some Solaris boxes, the generated Makefile does not make the correct
365 -fPIC/-fpic flags for the C compiler that is used. This requires manual
366 editing of the generated Makefile to switch case. Try it out once, and if
367 you get errors, try editing the -fpic line
369     INSTALLATION
371 Move to the directory bioperl-ext. This is available as a separate package
372 released from ftp://bioperl.org/pub/bioperl/DIST. This is where the C
373 code and XS extension for the bp_sw module is held and execute these
374 commands: (possibly after making the change for BSD and Solaris, as
375 detailed above)
377  perl Makefile.PL   # makes the system specific makefile
378  make          # builds all the libaries
379  make test     # runs a short test
380  make install  # installs the package correctly.
382 This should install the compiled extension. The Bio::Tools::pSW
383 module will work cleanly now.
385 DEPENDENCIES AND Bundle::BioPerl
387 The following packages are used by Bioperl. Not all are required for
388 Bioperl to operate properly, however some functionality will be missing
389 without them. You can easily install all of these, except srsperl.pm,
390 using the Bundle::BioPerl CPAN bundle.
392 The DBD::mysql, DB_File and XML::Parser modules require other applications
393 or databases: MySQL, Berkeley DB, and expat respectively.
395 +-----------------------------------------------------------------------------+
396 |        Module        |    Where it is Used   |   Bio* Modules Affected      |
397 |----------------------+-----------------------+------------------------------+
398 |                      |GenPept                |                              |
399 |HTTP::Request::Common |sequence retrieval,    |Bio::DB::*                    |
400 |                      |remote http BLAST jobs |Bio::Tools::Run::RemoteBlast  |
401 |----------------------+-----------------------+------------------------------|
402 |                      |GenBank, GenPept       |                              |
403 |LWP::UserAgent        |sequence retrieval,    |Bio::DB::*,                   |
404 |                      |remote http BLAST jobs |Bio::Tools::Run::RemoteBlast  |
405 |----------------------+-----------------------+------------------------------|
406 |Ace [1]               |Access to AceDB        |Bio::DB::Ace                  |
407 |                      |databases              |                              |
408 |----------------------+-----------------------+------------------------------|
409 |                      |                       |Bio::SeqIO, Bio::Variation::*,|
410 |IO::String            |handle to read or      |Bio::DB::*, Bio::Index::Blast,|
411 |                      |write to a string      |Bio::Tools::*, Bio::Biblio::IO|
412 |                      |                       |Bio::Structure::IO            |
413 |----------------------+-----------------------+------------------------------|
414 |XML::Parser [2]       |Parsing of XML         |Bio::Biblio::IO::medlinexml   |
415 |                      |documents              |                              |
416 |----------------------+-----------------------+------------------------------|
417 |XML::Writer           |Parsing + writing of   |Bio::SeqIO::game,             |
418 |                      |XML documents          |Bio::Variation::*             |
419 |----------------------+-----------------------+------------------------------|
420 |XML::Parser::PerlSAX  |Parsing of XML         |Bio::SeqIO::game,             |
421 |                      |documents              |Bio::Variation::*,            |
422 |                      |                       |Bio::Biblio::IO::medlinexml   |
423 |----------------------+-----------------------+------------------------------|
424 |                      |Parsing of XML         |Bio::Variation::IO::xml,      |
425 |XML::Twig             |documents              |Bio::DB::Biblio::eutils,      |
426 |                      |                       |Bio::Graph::IO::psi_xml       |
427 |----------------------+-----------------------+------------------------------|
428 |File::Temp            |Temporary File         |Bio::DB::FileCache,           |
429 |                      |creation               |Bio::DB::XEMBL                |
430 |----------------------+-----------------------+------------------------------|
431 |SOAP::Lite            |SOAP protocol,         |Bio::Biblio::*,               |
432 |                      |XEMBL Services         |Bio::DB::XEMBLService         |
433 |----------------------+-----------------------+------------------------------|
434 |HTML::Parser          |HTML parsing of        |Bio::DB::GDB                  |
435 |                      |GDB page               |                              |
436 |----------------------+-----------------------+------------------------------|
437 |                      |MySQL API for loading  |                              |
438 |DBD::mysql [3]        |and querying of MySQL- |Bio::DB::GFF, bioperl-db      |
439 |                      |based GFF feature      |bioperl-pipeline              |
440 |                      |and BioSQL databases   |                              |
441 |----------------------+-----------------------+------------------------------|
442 |GD [4][5]             |GD graphical drawing   |Bio::Graphics                 |
443 |                      |library                |                              |
444 |----------------------+-----------------------+------------------------------|
445 |Storable              |Persistent object      |Bio::DB::FileCache            |
446 |                      |storage & retrieval    |                              |
447 |----------------------+-----------------------+------------------------------|
448 |Text::Shellwords      |Text parser            |Bio::Graphics::FeatureFile    |
449 |----------------------+-----------------------+------------------------------|
450 |XML::DOM              |XML parser             |Bio::SeqIO::bsml,             |
451 |                      |                       |Bio::SeqIO::interpro          |
452 |----------------------+-----------------------+------------------------------|
453 |                      |Perl access to         |Bio::DB::Flat, Bio::DB::Fasta,|
454 |DB_File [6]           |Berkeley DB            |Bio::SeqFeature::Collection,  |
455 |                      |                       |Bio::Index::*                 |
456 |----------------------+-----------------------+------------------------------|
457 |Graph::Directed       |Generic graph data and |Bio::Ontology::               |
458 |                      |algorithms             |     SimpleOntologyEngine     |
459 |----------------------+-----------------------+------------------------------|
460 |Data::Stag::          |Structured Tags,       |Bio::SeqIO::chadoitext [7]    |
461 |    ITextWriter       |datastructures         |                              |
462 |----------------------+-----------------------+------------------------------|
463 |Data::Stag::          |Structured Tags,       |Bio::SeqIO::chadosxpr [7]     |
464 |    SxprWriter        |datastructures         |                              |
465 |----------------------+-----------------------+------------------------------|
466 |Data::Stag::XMLWriter |Structured Tags,       |Bio::SeqIO::chadoxml          |
467 |                      |datastructures         |                              |
468 |----------------------+-----------------------+------------------------------|
469 |Text::Wrap            |Very optional          |Bio::SearchIO::Writer::       |
470 |                      |                       |      TextResultWriter        |
471 |----------------------+-----------------------+------------------------------|
472 |HTML::Entities        |Parse BLAST results in |Bio::SearchIO::blastxml       |
473 |                      |XML                    |                              |
474 |----------------------+-----------------------+------------------------------|
475 |Class::AutoClass [8]  |Used to create objects |Bio::Graph::SimpleGraph*      |
476 |----------------------+-----------------------+------------------------------|
477 |Clone                 |Used to clone objects  |Bio::Graph::ProteinGraph      |
478 |----------------------+-----------------------+------------------------------|
479 |                      |                       |Bio::SeqIO::bsml_sax,         |
480 |XML::SAX              |New style SAX parser   |Bio::SeqIO::tigrxml,          |
481 |                      |                       |Bio::SearchIO::blastxml       |
482 |----------------------+-----------------------+------------------------------|
483 |XML::SAX::Base        |New style SAX parser   |Bio::SeqIO::tigrxml           |
484 |----------------------+-----------------------+------------------------------|
485 |XML::SAX::Writer      |                       |                              |
486 |----------------------+-----------------------+------------------------------|
487 |XML::SAX::ExpatXS     |New style SAX parser   |Bio::SearchIO::blastxml       |
488 |[2][9]                |                       |                              |
489 |----------------------+-----------------------+------------------------------|
490 |XML::Simple [2]       |Simple XML parsing     |Bio::DB::EUtilities           |
491 |----------------------+-----------------------+------------------------------|
492 |Convert::Binary::C    |Parsing of DNA strider |Bio::SeqIO::strider           |
493 |                      |documents              |                              |
494 |----------------------+-----------------------+------------------------------|
495 |Spreadsheet::         |Read Microsoft Excel   |Bio::SeqIO::excel             |
496 |    ParseExcel        |files                  |                              |
497 |----------------------+-----------------------+------------------------------|
498 |Bio::ASN1::EntrezGene |Parses ASN1 format     |Bio::SeqIO::entrezgene,       |
499 |                      |                       |Bio::DB::EntrezGene           |
500 +-----------------------------------------------------------------------------+
502 Notes
504     1. Available at http://stein.cshl.org 
505     2. Requires expat, at http://sourceforge.net/projects/expat/
506     3. Requires MySQL, from http://www.mysql.org 
507     4. Requires GD library (libgd) from http://www.boutell.com/gd 
508     5. Installing the GD library - libgd - is somewhat non-trivial since
509        there are a number of dependencies to consider. Matias Giovannini has
510        posted an excellent walkthrough for Mac OS X 10.4. 
511     6. Requires Berkeley DB, from Linux RPM or from
512        http://www.sleepycat.com 
513     7. These modules may be present in older distributions but are considered
514        redundant; use Bio::SeqIO::chadoxml instead. 
515     8. Bio::Graph::SimpleGraph requires Class::AutoClass v. 1.01;
516        earlier versions give very different results. 
517     9. This module is optional but recommended for speeding up parsing over
518        the default XML::SAX::PurePerl. If installed, XML::SAX::Expat currently
519        does not work correctly due to DTD problems.
520        
521