~ubuntu-branches/ubuntu/raring/bioperl/raring

« back to all changes in this revision

Viewing changes to Bio/Map/Microsatellite.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2008-03-18 14:44:57 UTC
  • mfrom: (4 hardy)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20080318144457-1jjoztrvqwf0gruk
* debian/control:
  - Removed MIA Matt Hope (dopey) from the Uploaders field.
    Thank you for your work, Matt. I hope you are doing well.
  - Downgraded some recommended package to the 'Suggests' priority,
    according to the following discussion on Upstream's mail list.
    http://bioperl.org/pipermail/bioperl-l/2008-March/027379.html
    (Closes: #448890)
* debian/copyright converted to machine-readable format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# BioPerl module for Bio::Map::Microsatellite
2
2
#
3
 
# Cared for by Chad Matsalla <bioinformatics1@dieselwurks.com>
 
3
# Cared for by Sendu Bala <bix@sendu.me.uk>
4
4
#
5
5
# Copyright Chad Matsalla
6
6
#
43
43
Bioperl modules. Send your comments and suggestions preferably to
44
44
the Bioperl mailing list.  Your participation is much appreciated.
45
45
 
46
 
  bioperl-l@bioperl.org              - General discussion
47
 
  http://bioperl.org/MailList.shtml  - About the mailing lists
 
46
  bioperl-l@bioperl.org                  - General discussion
 
47
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
48
48
 
49
49
=head2 Reporting Bugs
50
50
 
51
51
Report bugs to the Bioperl bug tracking system to help us keep track
52
 
of the bugs and their resolution. Bug reports can be submitted via
53
 
email or the web:
 
52
of the bugs and their resolution. Bug reports can be submitted via the
 
53
web:
54
54
 
55
 
  bioperl-bugs@bioperl.org
56
 
  http://bugzilla.bioperl.org/
 
55
  http://bugzilla.open-bio.org/
57
56
 
58
57
=head1 AUTHOR - Chad Matsalla
59
58
 
61
60
 
62
61
=head1 CONTRIBUTORS
63
62
 
64
 
Heikki Lehvaslaiho heikki@ebi.ac.uk
 
63
Heikki Lehvaslaiho heikki-at-bioperl-dot-org
65
64
Lincoln Stein      lstein@cshl.org
66
65
Jason Stajich      jason@bioperl.org
 
66
Sendu Bala         bix@sendu.me.uk
67
67
 
68
68
=head1 APPENDIX
69
69
 
75
75
# Let the code begin...
76
76
 
77
77
package Bio::Map::Microsatellite;
78
 
use vars qw(@ISA);
79
78
use strict;
80
 
use Bio::Root::Root;
81
 
use Bio::Map::Marker;
82
79
 
83
 
@ISA = qw(Bio::Map::Marker);
 
80
use base qw(Bio::Map::Marker);
84
81
 
85
82
=head2 new
86
83
 
137
134
    return $self;
138
135
}
139
136
 
140
 
=head2 Bio::Map::Marker methods
141
 
 
142
 
=cut
143
 
 
144
 
=head2 position
145
 
 
146
 
 Title   : position
147
 
 Usage   : my $position = $mappable->position($map); OR
148
 
           $mappable->position($map,$position); OR
149
 
 Function: Get/Set the Bio::Map::PositionI for a mappable element
150
 
           in a specific Map
151
 
 Returns : Bio::Map::PositionI
152
 
 Args    : $map =Bio::Map::MapI # Map we are talking about
153
 
           $position = Bio::Map::PositionI # Position we want to set
154
 
 
155
 
 
156
 
=head2 name($new_name)
157
 
 
158
 
 Title   : name($new_name)
159
 
 Usage   : $o_usat->name($new_name) _or_
160
 
           my $name = $o_usat->name()
161
 
 Function: Get/Set the name for this Microsatellite
162
 
 Returns : A scalar representing the current name of this Microsatellite
163
 
 Args    : If provided, the current name of this Microsatellite
164
 
           will be set to $new_name.
165
 
 
166
 
=head2 motif($new_motif)
167
 
 
168
 
 Title   : motif($new_motif)
169
 
 Usage   : my $motif = $o_usat->motif($new_motif) _or_
170
 
        my $motif = $o_usat->motif()
171
 
 Function: Get/Set the repeat motif for this Microsatellite
 
137
=head2 motif
 
138
 
 
139
 Title   : motif
 
140
 Usage   : $o_usat->motif($new_motif);
 
141
               my $motif = $o_usat->motif();
 
142
 Function: Get/Set the repeat motif for this Microsatellite.
172
143
 Returns : A scalar representing the current repeat motif of this
173
 
        Microsatellite.
174
 
 Args    : If provided, the current repeat motif of this Microsatellite
175
 
        will be set to $new_motif.
 
144
               Microsatellite.
 
145
 Args    : none to get, OR string to set
176
146
 
177
147
=cut
178
148
 
184
154
        return $self->{'_motif'};       
185
155
}
186
156
 
187
 
=head2 sequence($new_sequence)
 
157
=head2 sequence
188
158
 
189
 
 Title   : sequence($new_sequence)
190
 
 Usage   : my $sequence = $o_usat->sequence($new_sequence) _or_
191
 
        my $sequence = $o_usat->sequence()
192
 
 Function: Get/Set the sequence for this Microsatellite
 
159
 Title   : sequence
 
160
 Usage   : $o_usat->sequence($new_sequence);
 
161
               my $sequence = $o_usat->sequence();
 
162
 Function: Get/Set the sequence for this Microsatellite.
193
163
 Returns : A scalar representing the current sequence of this
194
 
        Microsatellite.
195
 
 Args    : If provided, the current sequence of this Microsatellite
196
 
        will be set to $new_sequence.
 
164
               Microsatellite.
 
165
 Args    : none to get, OR string to set
197
166
 
198
167
=cut
199
168
 
205
174
        return $self->{'_sequence'};    
206
175
}
207
176
 
208
 
=head2 repeats($new_repeats)
 
177
=head2 repeats
209
178
 
210
 
 Title   : repeats($new_repeats)
211
 
 Usage   : my $repeats = $o_usat->repeats($new_repeats) _or_
212
 
        my $repeats = $o_usat->repeats()
213
 
 Function: Get/Set the repeat repeats for this Microsatellite
 
179
 Title   : repeats
 
180
 Usage   : $o_usat->repeats($new_repeats);
 
181
               my $repeats = $o_usat->repeats()
 
182
 Function: Get/Set the repeat repeats for this Microsatellite.
214
183
 Returns : A scalar representing the current number of repeats of this
215
 
        Microsatellite.
216
 
 Args    : If provided, the current number of repeats of this
217
 
        Microsatellite will be set to $new_repeats.
 
184
               Microsatellite.
 
185
 Args    : none to get, OR int to set
218
186
 
219
187
=cut
220
188
 
226
194
        return $self->{'_repeats'};     
227
195
}
228
196
 
229
 
=head2 repeat_start_position($new_repeat_start_position)
 
197
=head2 repeat_start_position
230
198
 
231
 
 Title   : repeat_start_position($new_repeat_start_position)
232
 
 Usage   : my $repeat_start_position =
233
 
        $o_usat->repeat_start_position($new_repeat_start_position) _or_
234
 
        my $repeat_start_position = $o_usat->repeat_start_position()
 
199
 Title   : repeat_start_position
 
200
 Usage   : $o_usat->repeat_start_position($new_repeat_start_position);
 
201
               my $repeat_start_position = $o_usat->repeat_start_position();
235
202
 Function: Get/Set the repeat repeat_start_position for this
236
 
        Microsatellite
 
203
               Microsatellite
237
204
 Returns : A scalar representing the repeat start position for this 
238
 
        Microsatellite.
239
 
 Args    : If provided, the current repeat start position of this
240
 
        Microsatellite will be set to $new_repeat_start_position.
241
 
        This method will also try to set the repeat end position. This
242
 
        depends on having information for the motif and the number of
243
 
        repeats. If you want to use methods like get_trailing_flank or
244
 
        get_leading flank, be careful to include the right information.
 
205
               Microsatellite.
 
206
 Args    : none to get, OR string to set
 
207
               This method will also try to set the repeat end position. This
 
208
               depends on having information for the motif and the number of
 
209
               repeats. If you want to use methods like get_trailing_flank or
 
210
               get_leading flank, be careful to include the right information.
245
211
 
246
212
=cut
247
213
 
254
220
        return $self->{'_repeat_start_position'};       
255
221
}
256
222
 
257
 
=head2 repeat_end_position($value)
 
223
=head2 repeat_end_position
258
224
 
259
 
 Title   : repeat_end_position($set)
260
 
 Usage   : $new_repeat_end_position =
261
 
                $o_usat->repeat_end_position("set"); _or_
262
 
        $new_repeat_end_position =
263
 
                $o_usat->repeat_end_position($value); _or_
264
 
        $current_repeat_end_position = $o_usat->repeat_end_position();
265
 
 Function: get/set the end position of the repeat in this sequence
 
225
 Title   : repeat_end_position
 
226
 Usage   : $o_usat->repeat_end_position("set");
 
227
               $o_usat->repeat_end_position($value);
 
228
               $current_repeat_end_position = $o_usat->repeat_end_position();
 
229
 Function: Get/set the end position of the repeat in this sequence.
266
230
 Returns : A scalar representing the base index of the end of the
267
 
        repeat in this Microsatellite. The first base in the sequence
268
 
        is base 1.
 
231
               repeat in this Microsatellite. The first base in the sequence
 
232
               is base 1.
269
233
 Args    : A scalar representing a value, the string "set", or no
270
 
        argument (see Notes).
 
234
               argument (see Notes).
271
235
 Notes   : If you do not provide an argument to this method, the current
272
 
        end position of the repeat in this Microsatellite will be
273
 
        returned (a scalar).
274
 
        If you provide the string "set" to this method it will set the
275
 
        end position based on the start position, the length of the
276
 
        motif, and the nuimber of repeats.
277
 
        If you specify a value the current end position of the repeat
278
 
        will be set to that value. This is a really bad idea. Don't do
279
 
        it.
 
236
           end position of the repeat in this Microsatellite will be
 
237
           returned (a scalar).
 
238
           If you provide the string "set" to this method it will set the
 
239
           end position based on the start position, the length of the
 
240
           motif, and the number of repeats.
 
241
           If you specify a value the current end position of the repeat
 
242
           will be set to that value. This is a really bad idea. Don't do
 
243
           it.
280
244
 
281
245
=cut
282
246
 
283
 
#'
284
247
sub repeat_end_position {
285
248
    my ($self,$caller) = @_;
286
249
    if( defined $caller ) { 
299
262
=head2 equals
300
263
 
301
264
 Title   : equals
302
 
 Usage   : if( $mappable->equals($mapable2)) ...
 
265
 Usage   : if ($mappable->equals($mapable2)) {...}
303
266
 Function: Test if a position is equal to another position
304
267
 Returns : boolean
305
268
 Args    : Bio::Map::MappableI
308
271
 
309
272
sub equals {
310
273
        my ($self,@args) = @_;
311
 
        $self->warn("equals is not yet implemented in ".
312
 
                    ref($self)." yet. Check back real soon!");
 
274
        $self->throw_not_implemented();
313
275
}
314
276
 
315
277
=head2 less_than
316
278
 
317
279
 Title   : less_than
318
 
 Usage   : if( $mappable->less_than($m2) ) ...
 
280
 Usage   : if ($mappable->less_than($m2)) {...}
319
281
 Function: Tests if a position is less than another position
320
282
 Returns : boolean
321
283
 Args    : Bio::Map::MappableI
324
286
 
325
287
sub less_than {
326
288
        my ($self,@args) = @_;
327
 
        $self->warn("less_then is not yet implemented in ".
328
 
                    ref($self)." yet. Check back real soon!");
 
289
        $self->throw_not_implemented();
329
290
}
330
291
 
331
292
=head2 greater_than
332
293
 
333
294
 Title   : greater_than
334
 
 Usage   : if( $mappable->greater_than($m2) ) ...
 
295
 Usage   : if ($mappable->greater_than($m2)) {...}
335
296
 Function: Tests if position is greater than another position
336
297
 Returns : boolean
337
298
 Args    : Bio::Map::MappableI
340
301
 
341
302
sub greater_than {
342
303
        my ($self,@args) = @_;
343
 
        $self->warn("greater_then is not yet implemented in ".
344
 
                    ref($self)." yet. Check back real soon!");
 
304
        $self->throw_not_implemented();
345
305
}
346
306
 
347
 
=head2 get_leading_flank()
 
307
=head2 get_leading_flank
348
308
 
349
 
 Title   : get_leading_flank()
 
309
 Title   : get_leading_flank
350
310
 Usage   : $leading_sequence = $o_usat->get_leading_flank();
351
311
 Returns : A scalar representing the sequence before the repeats in this
352
 
        Microsatellite.
353
 
 Args    : None.
 
312
               Microsatellite.
 
313
 Args    : none
354
314
 
355
315
=cut
356
316
 
357
317
sub get_leading_flank {
358
318
        my $self = shift;
359
319
        return substr $self->sequence(),0,$self->repeat_start_position-1;
360
 
 
361
320
}
362
321
 
363
 
=head2 get_trailing_flank()
 
322
=head2 get_trailing_flank
364
323
 
365
 
 Title   : get_trailing_flank()
 
324
 Title   : get_trailing_flank
366
325
 Usage   : $trailing_flank = $o_usat->get_trailing_flank();
367
326
 Returns : A scalar representing the sequence after the repeats in this
368
 
        Microsatellite.
369
 
 Args    : None.
 
327
               Microsatellite.
 
328
 Args    : none
370
329
 
371
330
=cut
372
331
 
375
334
        return substr $self->sequence(),$self->repeat_end_position()-1;
376
335
}
377
336
 
378
 
 
379
337
1;
380
 
 
381