1 # $Id: Prediction.pm,v 1.10 2006/09/28 14:09:40 sendu Exp $
3 # BioPerl module for Bio::Map::Prediction
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Sendu Bala <bix@sendu.me.uk>
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::Map::Prediction - An object representing the predictions of something
18 that can have multiple locations in several maps.
22 use Bio::Map::Prediction;
23 use Bio::Map::Position;
25 # normally you would get predictions from a run wrapper like
26 # Bio::Tools::Run::Meme, but here we create some manually:
27 my $pred1 = Bio::Map::Prediction->new(-source => 'meme');
28 Bio::Map::Position->new(-element => $prediction1,
29 -map => Bio::Map::GeneMap->get(-gene => 'gene1',
30 -species => 'species1'),
33 Bio::Map::Position->new(-element => $prediction1,
34 -map => Bio::Map::GeneMap->get(-gene => 'gene1',
35 -species => 'species2'),
38 Bio::Map::Position->new(-element => $prediction1,
39 -map => Bio::Map::GeneMap->get(-gene => 'gene2',
40 -species => 'species1'),
43 Bio::Map::Position->new(-element => $prediction1,
44 -map => Bio::Map::GeneMap->get(-gene => 'gene2',
45 -species => 'species2'),
49 my $pred2 = Bio::Map::Prediction->new(-source => 'gerp');
50 Bio::Map::Position->new(-element => $prediction2,
51 -map => Bio::Map::GeneMap->get(-gene => 'gene1',
52 -species => 'species1'),
57 # find the places where predictions agree
58 use Bio::Map::GeneRelative;
59 my $rel = Bio::Map::GeneRelative->new(-gene => 0);
60 my $di = Bio::Map::Mappable->disconnected_intersections([$pred1, $pred2],
61 -min_mappables_percent => 100,
62 -min_map_percent => 100,
64 my @positions = $di->get_positions;
68 For example, used to model transcription factor binding site predictions, which
69 can have multiple locations in several maps.
75 User feedback is an integral part of the evolution of this and other
76 Bioperl modules. Send your comments and suggestions preferably to the
77 Bioperl mailing list. Your participation is much appreciated.
79 bioperl-l@bioperl.org - General discussion
80 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
84 Please direct usage questions or support issues to the mailing list:
86 I<bioperl-l@bioperl.org>
88 rather than to the module maintainer directly. Many experienced and
89 reponsive experts will be able look at the problem and quickly
90 address it. Please include a thorough description of the problem
91 with code and data examples if at all possible.
95 Report bugs to the Bioperl bug tracking system to help us keep track
96 of the bugs and their resolution. Bug reports can be submitted via the
99 https://github.com/bioperl/bioperl-live/issues
101 =head1 AUTHOR - Sendu Bala
103 Email bix@sendu.me.uk
107 The rest of the documentation details each of the object methods.
108 Internal methods are usually preceded with a _
112 # Let the code begin...
114 package Bio
::Map
::Prediction
;
117 use base
qw(Bio::Map::Mappable);
122 Usage : my $prediction = Bio::Map::Prediction->new();
123 Function: Builds a new Bio::Map::Prediction object
124 Returns : Bio::Map::Prediction
125 Args : -name => string : name of the mappable element
126 -id => string : id of the mappable element
127 -source => string : name of the prediction program
132 my ($class, @args) = @_;
133 my $self = $class->SUPER::new
(@args);
135 my ($source) = $self->_rearrange([qw(SOURCE)], @args);
136 $self->source($source) if $source;
144 Usage : $mappable->name($new_name);
145 my $name = $mappable->name();
146 Function: Get/Set the name for this Mappable
147 Returns : A scalar representing the current name of this Mappable
155 if (@_) { $self->{_source
} = shift }
156 return $self->{_source
} || '';