3 # BioPerl module for Bio::Tools::AlignFactory
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Ewan Birney <birney@sanger.ac.uk>
9 # Copyright Ewan Birney
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::Tools::AlignFactory - Base object for alignment factories
21 You wont be using this as an object, but using a dervied class
26 Holds common Alignment Factory attributes in place
30 http://bio.perl.org/ or birney@sanger.ac.uk
34 The rest of the documentation details each of the object
35 methods. Internal methods are usually preceded with a _
40 # Let the code begin...
42 package Bio
::Tools
::AlignFactory
;
45 use base
qw(Bio::Root::Root);
49 require Bio
::Ext
::Align
;
52 print STDERR
("\nThe C-compiled engine for Smith Waterman alignments (Bio::Ext::Align) has not been installed.\n Please install the bioperl-ext package\n\n");
58 my($class,@args) = @_;
59 my $self = $class->SUPER::new
(@args);
60 $self->_initialize(@args);
63 $self->{'kbyte'} = 20000;
64 $self->{'report'} = 0;
72 Usage : set/gets the amount of memory able to be used
74 : $factory->kbyte(200);
77 Argument : memory in kilobytes
82 my ($self,$value) = @_;
84 if( defined $value ) {
85 $self->{'kbyte'} = $value;
87 return $self->{'kbyte'};
94 Usage : set/gets the report boolean to issue reports or not
96 : $factory->report(1); # reporting goes on
104 my ($self,$value) = @_;
107 if( defined $value ) {
108 if( $value != 1 && $value != 0 ) {
109 $self->throw("Attempting to modify AlignFactory Report with no boolean value!");
111 $self->{'report'} = $value;
114 return $self->{'report'};
117 =head2 set_memory_and_report
119 Title : set_memory_and_report
120 Usage : Only used by subclasses.
129 sub set_memory_and_report
{
132 if( $self->{'kbyte'} < 5 ) {
133 $self->throw("You can suggest aligning things with less than 5kb");
136 &Bio
::Ext
::Align
::change_max_BaseMatrix_kbytes
($self->{'kbyte'});
138 if( $self->{'report'} == 0 ) {
139 &Bio
::Ext
::Align
::error_off
(16);
141 &Bio
::Ext
::Align
::error_on
(16);