Debian Codegraph @

blib/lib/TFBS/PatternI.pm

raw symbols SCIP
1 # TFBS module for TFBS::PatternI
2 #
3 # Copyright Boris Lenhard
4 #
5 # You may distribute this module under the same terms as perl itself
6 #
7
8 # POD
9
10 =head1 NAME
11
12 TFBS::PatternI - interface definition for all pattern objects (currently
13 includes matrices and word (consensus and regular expressions )
14
15 =head1 DESCRIPTION
16
17 TFBS::PatternI is a draft class that should contain general interface for matrix and other (future) pattern objects. It is not defined and not used yet, as I need to ponder over certain unresolved issues in general pattern definition. User feedback is more than welcome.
18
19 =head1 FEEDBACK
20
21 Please send bug reports and other comments to the author.
22
23 =head1 AUTHOR - Boris Lenhard
24
25 Boris Lenhard E<lt>[email protected]<gt>
26
27 =head1 APPENDIX
28
29 The rest of the documentation details each of the object
30 methods. Internal methods are preceded with an underscore.
31
32 =cut
33
34 # The code begins here:
35
36
37 # The code begins HERE:
38
39 package TFBS::PatternI;
40 use vars '@ISA';
41
42 use Bio::Root::Root;
43
44 use strict;
45
46 @ISA = qw(Bio::Root::Root);
47
48 #sub new {
49
50 #}
51
52 =head2 ID
53
54 Title : ID
55 Usage : my $ID = $icm->ID()
56 $pfm->ID('M00119');
57 Function: Get/set on the ID of the pattern (unique in a DB or a set)
58 Returns : pattern ID (a string)
59 Args : none for get, string for set
60
61 =cut
62
63 sub ID {
64 my ($self, $ID) = @_;
65 $self->{'ID'} = $ID if $ID;
66 return $self->{'ID'};
67 }
68
69
70 =head2 name
71
72 Title : name
73 Usage : my $name = $pwm->name()
74 $pfm->name('PPARgamma');
75 Function: Get/set on the name of the pattern
76 Returns : pattern name (a string)
77 Args : none for get, string for set
78
79 =cut
80
81 sub name {
82 my ($self, $name) = @_;
83 $self->{'name'} = $name if $name;
84 return $self->{'name'};
85 }
86
87
88 =head2 class
89
90 Title : class
91 Usage : my $class = $pwm->class()
92 $pfm->class('forkhead');
93 Function: Get/set on the structural class of the pattern
94 Returns : class name (a string)
95 Args : none for get, string for set
96
97 =cut
98
99
100 sub class {
101 my ($self, $class) = @_;
102 $self->{'class'} = $class if $class;
103 return $self->{'class'};
104 }
105
106 =head2 tag
107
108 Title : tag
109 Usage : my $acc = $pwm->tag('acc')
110 $pfm->tag(source => "Gibbs");
111 Function: Get/set on the structural class of the pattern
112 Returns : tag value (a scalar/reference)
113 Args : tag name (string) for get,
114 tag name (string) and value (any scalar/reference) for set
115
116 =cut
117
118 sub tag {
119 my $self = shift;
120 my $tag = shift || return;
121 if (scalar @_) {
122 $self->{'tags'}->{$tag} =shift;
123 }
124 return $self->{'tags'}->{$tag};
125 }
126
127
128 =head2 all_tags
129
130 Title : all_tags
131 Usage : my %tag = $pfm->all_tags();
132 Function: get a hash of all tags for a matrix
133 Returns : a hash of all tag values keyed by tag name
134 Args : none
135
136 =cut
137
138 sub all_tags {
139 return %{$_[0]->{'tags'}};
140 }
141
142
143
144
145 =head2 delete_tag
146
147 Title : delete_tag
148 Usage : $pfm->delete_tag('score');
149 Function: get a hash of all tags for a matrix
150 Returns : nothing
151 Args : a string (tag name)
152
153 =cut
154
155
156 sub delete_tag {
157 my ($self, $tag) = @_;
158 delete $self->{'tags'}->{$tag};
159 }
160
161
162
163 1;