1 # $Id: TranscriptionFactor.pm,v 1.6 2006/07/17 14:16:53 sendu Exp $
3 # BioPerl module for Bio::Map::TranscriptionFactor
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::TranscriptionFactor - A transcription factor modelled as a mappable
22 use Bio::Map::TranscriptionFactor;
23 use Bio::Map::GeneMap;
24 use Bio::Map::Position;
26 # model a TF that binds 500bp upstream of the BRCA2 gene in humans and
27 # 250bp upstream of BRCA2 in mice
28 my $tf = Bio::Map::TranscriptionFactor->get(-universal_name => 'tf1');
29 my $map1 = Bio::Map::GeneMap->get(-universal_name => "BRCA2",
31 my $map2 = Bio::Map::GeneMap->get(-universal_name => "BRCA2",
33 Bio::Map::Position->new(-map => $map1,
37 Bio::Map::Position->new(-map => $map2,
42 # Find out where the transcription factor binds
43 foreach $pos ($tf->get_positions) {
44 print $tf->universal_name, " binds at position " $pos->value, " relative to ",
45 $pos->relative->description, " of gene ",
46 $pos->map->universal_name, " in species ", $pos->map->species, "\n";
51 A transcription factor modelled as a mappable element. It can have mulitple
52 binding sites (positions) near multiple genes (maps).
58 User feedback is an integral part of the evolution of this and other
59 Bioperl modules. Send your comments and suggestions preferably to the
60 Bioperl mailing list. Your participation is much appreciated.
62 bioperl-l@bioperl.org - General discussion
63 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
67 Please direct usage questions or support issues to the mailing list:
69 I<bioperl-l@bioperl.org>
71 rather than to the module maintainer directly. Many experienced and
72 reponsive experts will be able look at the problem and quickly
73 address it. Please include a thorough description of the problem
74 with code and data examples if at all possible.
78 Report bugs to the Bioperl bug tracking system to help us keep track
79 of the bugs and their resolution. Bug reports can be submitted via the
82 https://redmine.open-bio.org/projects/bioperl/
84 =head1 AUTHOR - Sendu Bala
90 The rest of the documentation details each of the object methods.
91 Internal methods are usually preceded with a _
95 # Let the code begin...
97 package Bio
::Map
::TranscriptionFactor
;
100 use base
qw(Bio::Map::Mappable);
107 Usage : my $tf = Bio::Map::TranscriptionFactor->new();
108 Function: Builds a new Bio::Map::TranscriptionFactor object
109 Returns : Bio::Map::TranscriptionFactor
110 Args : -universal_name => string name of the TF (in a form common to all
111 species that have the TF, but unique amongst
112 non-orthologous TFs), REQUIRED
113 -description => string, free text description of the TF
118 my ($class, @args) = @_;
119 my $self = $class->SUPER::new
(@args);
121 my ($u_name, $desc) = $self->_rearrange([qw(UNIVERSAL_NAME DESCRIPTION)], @args);
122 $u_name || $self->throw("You must supply a -universal_name");
123 $self->universal_name($u_name);
125 defined $desc && $self->description($desc);
133 Usage : my $obj = Bio::Map::TranscriptionFactor->get();
134 Function: Builds a new Bio::Map::TranscriptionFactor object (like new()), or
135 gets a pre-existing one that shares the same universal_name.
136 Returns : Bio::Map::TranscriptionFactor
137 Args : -universal_name => string name of the TF (in a form common to all
138 species that have the TF, but unique amongst
139 non-orthologous TFs), REQUIRED
140 -description => string, free text description of the TF
145 my ($class, @args) = @_;
146 my ($u_name) = Bio
::Root
::Root
->_rearrange([qw(UNIVERSAL_NAME)], @args);
148 if ($u_name && defined $TFS->{$u_name}) {
149 return $TFS->{$u_name};
152 return $class->new(@args);
155 =head2 universal_name
157 Title : universal_name
158 Usage : my $name = $obj->universal_name
159 Function: Get/Set TF name, corresponding to the name of the TF in a form shared
160 by orthologous versions of the TF in different species, but otherwise
163 Args : none to get, OR string to set
168 my ($self, $value) = @_;
169 if (defined $value) {
170 delete $TFS->{$self->{'_uname'}} if $self->{'_uname'};
171 $self->{'_uname'} = $value;
172 $TFS->{$value} = $self;
174 return $self->{'_uname'};
180 Usage : my $desc = $obj->description
181 Function: Get/Set a description of the TF.
183 Args : none to get, OR string to set
189 if (@_) { $self->{desc
} = shift }
190 return $self->{desc
} || '';