1
# $Id: Prediction.pm,v 1.10 2006/09/28 14:09:40 sendu Exp $
3
# BioPerl module for Bio::Map::Prediction
5
# Cared for by Sendu Bala <bix@sendu.me.uk>
9
# You may distribute this module under the same terms as perl itself
11
# POD documentation - main docs before the code
15
Bio::Map::Prediction - An object representing the predictions of something
16
that can have multiple locations in several maps.
20
use Bio::Map::Prediction;
21
use Bio::Map::Position;
23
# normally you would get predictions from a run wrapper like
24
# Bio::Tools::Run::Meme, but here we create some manually:
25
my $pred1 = Bio::Map::Prediction->new(-source => 'meme');
26
Bio::Map::Position->new(-element => $prediction1,
27
-map => Bio::Map::GeneMap->get(-gene => 'gene1',
28
-species => 'species1'),
31
Bio::Map::Position->new(-element => $prediction1,
32
-map => Bio::Map::GeneMap->get(-gene => 'gene1',
33
-species => 'species2'),
36
Bio::Map::Position->new(-element => $prediction1,
37
-map => Bio::Map::GeneMap->get(-gene => 'gene2',
38
-species => 'species1'),
41
Bio::Map::Position->new(-element => $prediction1,
42
-map => Bio::Map::GeneMap->get(-gene => 'gene2',
43
-species => 'species2'),
47
my $pred2 = Bio::Map::Prediction->new(-source => 'gerp');
48
Bio::Map::Position->new(-element => $prediction2,
49
-map => Bio::Map::GeneMap->get(-gene => 'gene1',
50
-species => 'species1'),
55
# find the places where predictions agree
56
use Bio::Map::GeneRelative;
57
my $rel = Bio::Map::GeneRelative->new(-gene => 0);
58
my $di = Bio::Map::Mappable->disconnected_intersections([$pred1, $pred2],
59
-min_mappables_percent => 100,
60
-min_map_percent => 100,
62
my @positions = $di->get_positions;
66
For example, used to model transcription factor binding site predictions, which
67
can have multiple locations in several maps.
73
User feedback is an integral part of the evolution of this and other
74
Bioperl modules. Send your comments and suggestions preferably to the
75
Bioperl mailing list. Your participation is much appreciated.
77
bioperl-l@bioperl.org - General discussion
78
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
82
Report bugs to the Bioperl bug tracking system to help us keep track
83
of the bugs and their resolution. Bug reports can be submitted via the
86
http://bugzilla.open-bio.org/
88
=head1 AUTHOR - Sendu Bala
94
The rest of the documentation details each of the object methods.
95
Internal methods are usually preceded with a _
99
# Let the code begin...
101
package Bio::Map::Prediction;
104
use base qw(Bio::Map::Mappable);
109
Usage : my $prediction = Bio::Map::Prediction->new();
110
Function: Builds a new Bio::Map::Prediction object
111
Returns : Bio::Map::Prediction
112
Args : -name => string : name of the mappable element
113
-id => string : id of the mappable element
114
-source => string : name of the prediction program
119
my ($class, @args) = @_;
120
my $self = $class->SUPER::new(@args);
122
my ($source) = $self->_rearrange([qw(SOURCE)], @args);
123
$self->source($source) if $source;
131
Usage : $mappable->name($new_name);
132
my $name = $mappable->name();
133
Function: Get/Set the name for this Mappable
134
Returns : A scalar representing the current name of this Mappable
142
if (@_) { $self->{_source} = shift }
143
return $self->{_source} || '';