~ubuntu-branches/ubuntu/lucid/bioperl/lucid

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
# $Id: INSTALL 15257 2008-12-24 05:27:05Z cjfields $

Installing BioPerl for Unix

     * 1 BIOPERL INSTALLATION
     * 2 SYSTEM REQUIREMENTS
     * 3 OPTIONAL
     * 4 ADDITIONAL INSTALLATION INFORMATION
     * 5 THE BIOPERL BUNDLE
     * 6 PRELIMINARY PREPARATION
     * 7 INSTALLING BIOPERL THE EASY WAY USING CPAN
     * 8 INSTALLING BIOPERL THE EASY WAY USING 'Build.PL'
     * 9 WHERE ARE THE MAN PAGES?
     * 10 EXTERNAL PROGRAMS

          * 10.1 Environment Variables

     * 11 INSTALLING BIOPERL SCRIPTS
     * 12 INSTALLING BIOPERL IN A PERSONAL MODULE AREA
     * 13 INSTALLING BIOPERL MODULES THE HARD WAY
     * 14 USING MODULES NOT INSTALLED IN THE STANDARD LOCATION
     * 15 THE TEST SYSTEM
     * 16 BUILDING THE OPTIONAL bioperl-ext PACKAGE

          * 16.1 CONFIGURING for BSD and Solaris boxes
          * 16.2 INSTALLATION

BIOPERL INSTALLATION

For the most up-to-date installation instructions please see the
BioPerl wiki:

  http://www.bioperl.org/wiki/Installing_BioPerl

BioPerl has been installed on many forms of Unix, Win9X/NT/2000/XP,
and on Mac OS X (see the PLATFORMS file for more details). Following
are instructions for installing BioPerl for Unix/Linux/Mac OS X;
Windows installation instructions can be found in INSTALL.WIN. For
installing BioPerl for Mac OS X using Fink, see:

http://www.bioperl.org/wiki/Getting_BioPerl#Mac_OS_X_using_fink

SYSTEM REQUIREMENTS

    * Perl 5.6.1 or later; version 5.8 and greater are highly
      recommended. Modules are generally tested against perl 5.8 and
      above.

    * External modules: BioPerl uses functionality provided in other
      Perl modules. Some of these are included in the standard perl
      package but some need to be obtained from the CPAN site. The
      list of external modules is included in the DEPENDENCIES file.

OPTIONAL

   * ANSI C or GNU C compiler (gcc) for XS extensions (the bioperl-ext
     package; see BUILDING THE OPTIONAL bioperl-ext PACKAGE, below).

ADDITIONAL INSTALLATION INFORMATION

   * Additional information on BioPerl and MAC OS:
      * OS 9 - http://bioperl.org/Core/mac-bioperl.html
            NOTE: These are severely out-of-date and require MacPerl
            (the latest version of which is 5.6.1rc1). As such, we do
            not currently support BioPerl on OS 9
      * OS X - http://www.tc.umn.edu/~cann0010/Bioperl_OSX_install.html
            (outdated, but useful for libgd installation notes)
      * OS X - Installing using Fink (in Getting BioPerl)

THE BIOPERL BUNDLE

Users of previous versions of BioPerl may remember Bundle::BioPerl.
You no longer need to install Bundle::BioPerl. Instead, the normal
installation process will ask you if you'd like to install optional
external module dependencies that BioPerl has.

A full list of BioPerl dependencies can be found in the DEPENDENCIES
file included with this distribution.

PRELIMINARY PREPARATION

   This is optional, but regardless of your subsequent choice of
   installation method, it will help to carry out the following steps.
   They will increase the likelyhood of installation success
   (especially of optional dependencies).

     * Upgrade CPAN:

 >perl -MCPAN -e shell
 cpan>install Bundle::CPAN
 cpan>q

     * Install/upgrade Module::Build, and make it your preferred
       installer:

 >cpan
 cpan>install Module::Build
 cpan>o conf prefer_installer MB
 cpan>o conf commit
 cpan>q

     * Install the expat and libgd libraries by whatever method is
       appropriate for your system. If you install libgd in a
       non-standard location, that is fine: when installing the perl
       module that needs it you will be asked where you installed it.

     * If your expat library is installed in a non-standard location,
       tell CPAN about it:

 >cpan
 cpan>o conf makepl_arg "EXPATLIBPATH=/non-standard/lib EXPATINCPATH=/non-standard/include"
 cpan>o conf commit

INSTALLING BIOPERL THE EASY WAY USING CPAN

You can use the CPAN shell to install BioPerl. For example:

 >perl -MCPAN -e shell
 
Or you might have the cpan alias installed:

 >cpan

Then find the name of the BioPerl version you want:

 cpan>d /bioperl/
 CPAN: Storable loaded ok
 Going to read /home/bosborne/.cpan/Metadata
 Database was generated on Mon, 20 Nov 2006 05:24:36 GMT
 Distribution B/BI/BIRNEY/bioperl-1.2.tar.gz
 Distribution B/BI/BIRNEY/bioperl-1.4.tar.gz
 Distribution S/SE/SENDU/bioperl-1.5.2_100.tar.gz

Now install:

 cpan>install S/SE/SENDU/bioperl-1.5.2_100.tar.gz

If you've installed everything perfectly and all the network
connections are working then you may pass all the tests run in the
'./Build test' phase. It's also possible that you may fail some tests.
Possible explanations: problems with local Perl installation, network
problems, previously undetected bug in BioPerl, flawed test script,
problems with CGI script used for sequence retrieval at public
database, and so on. Remember that there are over 900 modules in
BioPerl and the test suite is running more than 12000 individual
tests, a few failed tests may not affect your usage of BioPerl.

If you decide that the failed tests will not affect how you intend to
use BioPerl and you'd like to install anyway do:

 cpan>force install S/SE/SENDU/bioperl-1.5.2_100.tar.gz

This is what most experienced BioPerl users would do. However, if
you're concerned about a failed test and need assistance or advice
then contact bioperl-l@bioperl.org. (You could provide us the detailed
results of the failed test(s): see the `THE TEST SYSTEM' below for
information on how to generate such results.)

INSTALLING BIOPERL THE EASY WAY USING Build.PL

The advantage of this approach is it's stepwise, so it's easy to stop
and analyze in case of any problem.

Download, then unpack the tar file. For example:

 >gunzip bioperl-1.5.2_100.tar.gz
 >tar xvf bioperl-1.5.2_100.tar
 >cd bioperl-1.5.2_100

Now issue the build commands:

 >perl Build.PL
 >./Build test

If you've installed everything perfectly and all the network
connections are working then you may pass all the tests run in the
'./Build test' phase. It's also possible that you may fail some tests.
Possible explanations: problems with local Perl installation, network
problems, previously undetected bug in BioPerl, flawed test script,
problems with CGI script using for sequence retrieval at public
database, and so on. Remember that there are over 900 modules in
BioPerl and the test suite is running more than 12000 individual
tests, a few failed tests may not affect your usage of BioPerl.

If you decide that the failed tests will not affect how you intend to
use BioPerl and you'd like to install anyway, or if all tests were
fine, do:

 >./Build install

This is what most experienced BioPerl users would do. However, if
you're concerned about a failed test and need assistance or advice
then contact bioperl-l@bioperl.org. (You could provide us the detailed
results of the failed test(s): see the `THE TEST SYSTEM' below for
information on how to generate such results.)

To './Build install' you need write permission in the
perl5/site_perl/source area (or similar, depending on your
environment). Usually this will require you becoming root, so you will
want to talk to your systems manager if you don't have the necessary
privileges.

It is also straightforward to install the package outside of the this
standard Perl5 location. See INSTALLING BIOPERL IN A PERSONAL MODULE
AREA, below.

WHERE ARE THE MAN PAGES?

Previously, when using Makefile.PL (no longer covered in this
documentation), we had to disable the automatic creation of man pages
because this step was triggering a "line too long" error on some OSs
due to shell constraints. If you want man pages installed use the
Build.PL installation process discussed above. 

EXTERNAL PROGRAMS

BioPerl can interface with some external programs for executing
analyses. These include clustalw and t_coffee for Multiple Sequence
Alignment (Bio::Tools::Run::Alignment::Clustalw and
Bio::Tools::Run::Alignment::TCoffee) and blastall, blastpgp, and
bl2seq for BLAST analyses (Bio::Tools::Run::StandAloneBlast), and to
all the programs in the EMBOSS suite (Bio::Factory::EMBOSS).  Most
of the modules which 'wrap' these programs are located in the separate
bioperl-run distribution; however, two commonly-used modules are still
distributed with the BioPerl core (Bio::Tools::Run::StandAloneBlast,
Bio::Tools::Run::RemoteBlast).  

    Environment Variables

Some modules which run external programs need certain environment
variables set. If you do not have a local copy of the specific
executable you do not need to set these variables. Additionally the
modules will attempt to locate the specific applications in your
runtime PATH variable. You may also need to set an environment
variable to tell BioPerl about your network configuration if your site
uses a firewall.

Setting environment variables on unix means adding lines like the
following to your shell *rc file.

   For bash or sh:

 export BLASTDIR=/data1/blast

   For csh or tcsh:

 setenv BLASTDIR /data1/blast

Some environment variables include:

+------------------------------------------------------------------------+
| Env. Variable |                      Description                       |
|---------------+--------------------------------------------------------|
|               |Specifies where the NCBI blastall, blastpgp, bl2seq,    |
|BLASTDIR       |etc.. are located. A 'data' directory could also be     |
|               |present in this directory as well, you could put your   |
|               |blastable databases here.                               |
|---------------+--------------------------------------------------------|
|               |If one does not want to locate the data dir within the  |
|BLASTDATADIR or|same dir as where the BLASTDIR variable points, a       |
|BLASTDB        |BLASTDATADIR or BLASTDB variable can be set to point to |
|               |a dir where BLAST database indexes are located.         |
|---------------+--------------------------------------------------------|
|BLASTMAT       |The directory containing the substitution matrices such |
|               |as BLOSUM62.                                            |
|---------------+--------------------------------------------------------|
|CLUSTALDIR     |The directory where the clustalw executable is located. |
|---------------+--------------------------------------------------------|
|TCOFFEEDIR     |The directory where the t_coffee executable is located. |
|---------------+--------------------------------------------------------|
|               |If you access the internet via a proxy server then you  |
|               |can tell the BioPerl modules which require network      |
|               |access about this by using the http_proxy environment   |
|http_proxy     |variable. The value set includes the proxy address and  |
|               |the port, with optional username/password for           |
|               |authentication purposes                                 |
|               |(e.g. http://USERNAME:PASSWORD@proxy.example.com:8080). |
+------------------------------------------------------------------------+

INSTALLING BIOPERL SCRIPTS

BioPerl comes with a set of production-quality scripts that are
kept in the scripts/ directory. You can install these scripts if you'd
like, simply answer the questions during 'perl Build.PL'.
The installation directory can be specified by:

 perl Build.PL
 ./Build install --install_path script=/foo/scripts
 
By default they install to /usr/bin or similar, depending on platform.

INSTALLING BIOPERL IN A PERSONAL MODULE AREA

If you lack permission to install perl modules into the standard
site_perl/ system area you can configure BioPerl to install itself
anywhere you choose. Ideally this would be a personal perl directory
or standard place where you plan to put all your 'local' or personal
perl modules.

   Example:

 >perl Build.PL --install_base /home/users/dag
 >./Build test
 >./Build install

This tells perl to install all the various parts of bioperl in the
desired place, e.g. creating:

   /home/users/dag/lib/perl5/Bio/Perl.pm

Then in your BioPerl script you would write:

 use lib "/home/users/dag/lib/perl5/";
 use Bio::Perl;

For more information on these sorts of custom installs see the
documentation for Module::Build.

If you are used to using something like:

 >perl Makefile.PL PREFIX=/home/users/dag

You can get similar behaviour by using this instead:

 >perl Build.PL --prefix /home/users/dag

For more information, see Module::Build::Cookbook documentation for
Installing_in_the_same_location_as_ExtUtils::MakeMaker

You can also use CPAN to install modules in your local directory.
First enter the CPAN shell, then set the arguments for the commands
"perl Makefile.PL" and "./Build install", like this:

 >perl -e shell -MCPAN
 cpan>o conf makepl_arg LIB=/home/users/dag/My_Local_Perl_Modules
 cpan>o conf mbuild_install_arg "--install_path lib=/home/users/dag/My_Local_Perl_Modules"
 cpan>o conf commit

INSTALLING BIOPERL MODULES THE HARD WAY

As a last resort, you can simply copy all files in Bio/ to any
directory in which you have write privileges. This is generally NOT
recommended since some modules may require special configuration
(currently none do, but don't rely on this).

You will need to set "use lib '/path/to/my/bioperl/modules';" in your
perl scripts so that you can access these modules if they are not
installed in the standard site_perl/ location. See above for an
example.

To get manpage documentation to work correctly you will have to
configure man so that it looks in the proper directory. On most
systems this will just involve adding an additional directory to your
$MANPATH environment variable.

The installation of the Compile directory can be similarly redirected,
but execute the make commands from the Compile/SW directory.

If all else fails and you are unable to access the perl distribution
directories, ask your system administrator to place the files there
for you. You can always execute perl scripts in the same directory as
the location of the modules (Bio/ in the distribution) since perl
always checks the current working directory when looking for modules.

USING MODULES NOT INSTALLED IN THE STANDARD LOCATION

You can explicitly tell perl where to look for modules by using the
Lib module which comes standard with perl.

   Example:

 #!/usr/bin/perl
 use lib "/home/users/dag/lib/perl5/";
 use Bio::Perl;
 #<...insert whizzy perl code here...>

Or, you can set the environmental variable PERL5LIB:

   csh or tcsh:

 setenv PERL5LIB /home/users/dag/lib/perl5/

   bash or sh:

 export PERL5LIB=/home/users/dag/lib/perl5/

THE TEST SYSTEM

The BioPerl test system is located in the t/ directory and is
automatically run whenever you execute the './Build test' command
(having previously run 'Perl Build.PL'; if you have already installed
BioPerl answer 'no' to script installation to get nicer test output
later). 

For the 1.6 release and beyond, tests have been organized into groups
based upon the specific task or class the module ibeing tested belongs
to. If you want to investigate the behavior of a specific test such as
the Seq test you would type: 

 >./Build test --test_files t/Seq/Seq.t --verbose

The ./ ensures you are using the Build script in the current directory
to make sure you are testing the modules in this directory not ones
installed elsewhere. The --test_files arguement can be used multiple
times to try a set of test scripts in one go. The --verbose arguement
outputs the detailed test results, instead of just the summary you see
during './Build test'.

The '--test-files' argument can also work as a glob. For instance, to
run tests on all SearchIO modules, use the following:

 >./Build test --test_files t/SearchIO* --verbose

If you are trying to learn how to use a module, often the test suite
is a good place to look. All good extreme programmers try and write a
test BEFORE they write the module to insure that their module behaves
the way they expect. You'll notice some 'ok' and 'skip' commands in a
test, this is part of the Perl test suite that signifies a passed test
with an 'ok N', where N is the test number. Alternatively you can tell
Perl to skip tests. This is useful when, for example, your test
detects that the network is not present and thus should skip, not
fail, any tests that require a network connection.

The core developers have indicated that future releases of BioPerl
will require that new modules come with a test suite with some minimal
tests.  Modules that lack adequate tests or could otherwise be
considered 'unstable' will be moved into a separate developer
distribution until adequate tests are added and the API stablizes.

BUILDING THE OPTIONAL bioperl-ext PACKAGE

The bioperl-ext package contains C code and XS extensions for various
alignment and trace file modules (Bio::Tools::pSW for DNA
Smith-Waterman, Bio::Tools::dpAlign for protein Smith-Waterman,
Bio::SearchDist for EVD fitting of extreme value, Bio::SeqIO::staden).

This Installation may work out-of-the box for most platforms except
BSD and Solaris boxes. For other platforms skip this next paragraph.
Of note, the code for bioperl-ext has not been updated along with the
rest of bioperl, so one may expect to see some issues. If so, please
report them to the BioPerl mailing list. Patches for these modules are
always welcome.

    CONFIGURING for BSD and Solaris boxes

You should add the line -fPIC to the CFLAGS line in
Compile/SW/libs/makefile. This makes the compile generate position
independent code, which is required for these architectures. In
addition, on some Solaris boxes, the generated Makefile does not make
the correct -fPIC/-fpic flags for the C compiler that is used. This
requires manual editing of the generated Makefile to switch case. Try
it out once, and if you get errors, try editing the -fpic line

    INSTALLATION

Move to the directory bioperl-ext. This is available as a separate
package released from ftp://bioperl.org/pub/bioperl/DIST. This is
where the C code and XS extension for the bp_sw module is held and
execute these commands: (possibly after making the change for BSD and
Solaris, as detailed above)

 perl Makefile.PL   # makes the system specific makefile
 make          # builds all the libaries
 make test     # runs a short test
 make install  # installs the package correctly.

This should install the compiled extension. The Bio::Tools::pSW module
will work cleanly now.