3 # BioPerl module for Bio::Map::clone
5 # Cared for by Sendu Bala <bix@sendu.me.uk>
7 # Copyright Gaurav Gupta
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
15 Bio::Map::Clone - An central map object representing a clone
19 # get the clone object of $clone from the Bio::Map::Clone
20 my $cloneobj = $physical->get_cloneobj($clone);
22 # acquire all the markers that hit this clone
23 foreach my $marker ($cloneobj->each_markerid()) {
24 print " +++$marker\n";
27 See L<Bio::Map::Position> and L<Bio::Map::PositionI> for more information.
31 This object handles the notion of a clone. This clone will
32 have a name and a position in a map.
34 This object is intended to be used by a map parser like fpc.pm.
40 User feedback is an integral part of the evolution of this and other
41 Bioperl modules. Send your comments and suggestions preferably to
42 the Bioperl mailing list. Your participation is much appreciated.
44 bioperl-l@bioperl.org - General discussion
45 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
49 Report bugs to the Bioperl bug tracking system to help us keep track
50 of the bugs and their resolution. Bug reports can be submitted via the
53 http://bugzilla.open-bio.org/
55 =head1 AUTHOR - Gaurav Gupta
57 Email gaurav@genome.arizona.edu
61 Sendu Bala bix@sendu.me.uk
63 =head1 PROJECT LEADERS
65 Jamie Hatfield jamie@genome.arizona.edu
66 Dr. Cari Soderlund cari@genome.arizona.edu
68 =head1 PROJECT DESCRIPTION
70 The project was done in Arizona Genomics Computational Laboratory (AGCoL)
71 at University of Arizona.
73 This work was funded by USDA-IFAFS grant #11180 titled "Web Resources for
74 the Computation and Display of Physical Mapping Data".
76 For more information on this project, please refer:
77 http://www.genome.arizona.edu
81 The rest of the documentation details each of the object methods.
82 Internal methods are usually preceded with a _
86 # Let the code begin...
88 package Bio
::Map
::Clone
;
90 use Bio
::Map
::Position
;
92 use base
qw(Bio::Root::Root Bio::Map::MappableI);
97 Usage : my $clone = Bio::Map::Clone->new
100 -markers => \@markers,
107 -fpnumber=> $fp_number,
108 -sequencetype => $seq_type,
109 -sequencestatus=> $seq_status,
110 -fpcremark => $fpc_remark,
114 -range => Bio::Range->new(-start => $startrange,
117 Function: Initialize a new Bio::Map::Clone object
118 Most people will not use this directly but get Clones
119 through L<Bio::MapIO::fpc>
120 Returns : L<Bio::Map::Clone> object
121 Args : -name => marker name string,
122 -markers => array ref of markers,
123 -contig => contig name string,
124 -type => type string,
125 -bands => band string,
127 -group => group name string,
128 -remark => remark string,
129 -fpnumber=> FP number string,
130 -sequencetype => seq type string,
131 -sequencestatus=> seq status string,
132 -fpcremark => FPC remark,
133 -matche => array ref,
134 -matcha => array ref,
135 -matchp => array ref,
136 -range => L<Bio::Range> object,
141 my ($class,@args) = @_;
142 my $self= $class->SUPER::new
(@args);
144 my ($name,$markers,$contig,$type,$bands,$gel,$group,
145 $remark,$fpnumber,$seqtype,$seqstatus,$fpcremark,
146 $matche,$matcha,$matchp,
147 $range) = $self->_rearrange([qw(NAME MARKERS CONTIG TYPE
148 BANDS GEL GROUP REMARK FPNUMBER
149 SEQUENCETYPE SEQUENCESTATUS
150 FPCREMARK MATCHE MATCHA MATCHP
153 $self->name($name) if defined $name;
154 $self->markers($markers) if defined $markers;
155 $self->contigid($contig) if defined $contig;
156 $self->type($type) if defined $type;
157 $self->bands($bands) if defined $bands;
158 $self->gel($gel) if defined $gel;
159 $self->group($group) if defined $group;
160 $self->remark($remark) if defined $remark;
161 $self->fp_number($fpnumber) if defined $fpnumber;
162 $self->sequence_type($seqtype) if defined $seqtype;
163 $self->sequence_status($seqstatus) if defined $seqstatus;
164 $self->fpc_remark($fpcremark) if defined $fpcremark;
165 $self->range($range) if defined $range;
167 $self->set_match('approx', $matcha) if defined $matcha;
168 $self->set_match('pseudo', $matchp) if defined $matchp;
169 $self->set_match('exact', $matche) if defined $matche;
174 =head1 Access Methods
176 These methods let you get and set the member variables
181 Usage : my $name = $cloneobj->name();
182 Function: Get/set the name for this Clone
183 Returns : scalar representing the current name of this clone
184 Args : none to get, OR string to set
190 return $self->{'_name'} = shift if @_;
191 return $self->{'_name'};
197 Usage : my $type = $cloneobj->type();
198 Function: Get/set the type for this clone
199 Returns : scalar representing the current type of this clone
200 Args : none to get, OR string to set
206 return $self->{'_type'} = shift if @_;
207 return $self->{'_type'};
213 Usage : my $range = $cloneobj->range();
214 Function: Get/set the range of the contig that this clone covers
215 Returns : Bio::Range representing the current range of this contig,
216 start and end of the contig can be thus found using:
217 my $start = $contigobj->range()->start();
218 my $end = $contigobj->range()->end();
219 Args : none to get, OR Bio::Range to set
225 return $self->{'_range'} = shift if @_;
226 return $self->{'_range'};
232 Usage : @eclone = $cloneobj->match('exact');
233 @aclone = $cloneobj->match('approximate');
234 @pclone = $cloneobj->match('pseudo');
235 Function: get all matching clones
237 Args : scalar representing the type of clone to be
243 my ($self,$type) = @_;
245 $type = "_match" . lc(substr($type, 0, 1));
246 return @
{$self->{$type} || []};
252 Function: Synonym of the match() method.
256 *each_match
= \
&match
;
261 Usage : $clone->set_match($type,$values);
262 Function: Set the Matches per type
264 Args : type (one of 'exact' 'approx' 'pseudo')
265 array ref of match values
270 my ($self,$type,$val) = @_;
271 $type = "_match" . lc(substr($type, 0, 1));
272 $self->{$type} = $val;
278 Usage : $clonegel = $cloneobj->gel();
279 Function: Get/set the gel number for this clone
280 Returns : scalar representing the gel number of this clone
281 Args : none to get, OR string to set
287 return $self->{'_gel'} = shift if @_;
288 return $self->{'_gel'};
294 Usage : $cloneremark = $cloneobj->remark();
295 Function: Get/set the remark for this clone
296 Returns : scalar representing the current remark of this clone
297 Args : none to get, OR string to set
303 return $self->{'_remark'} = shift if @_;
304 return $self->{'_remark'};
310 Usage : $clonefpnumber = $cloneobj->fp_number();
311 Function: Get/set the fp number for this clone
312 Returns : scalar representing the fp number of this clone
313 Args : none to get, OR string to set
319 return $self->{'_fpnumber'} = shift if @_;
320 return $self->{'_fpnumber'};
325 Title : sequence_type
326 Usage : $cloneseqtype = $cloneobj->sequence_type();
327 Function: Get/set the sequence type for this clone
328 Returns : scalar representing the sequence type of this clone
329 Args : none to get, OR string to set
335 return $self->{'_sequencetype'} = shift if @_;
336 return $self->{'_sequencetype'};
339 =head2 sequence_status
341 Title : sequence_status
342 Usage : $cloneseqstatus = $cloneobj->sequence_status();
343 Function: Get/set the sequence status for this clone
344 Returns : scalar representing the sequence status of this clone
345 Args : none to get, OR string to set
349 sub sequence_status
{
351 return $self->{'_sequencestatus'} = shift if @_;
352 return $self->{'_sequencestatus'};
358 Usage : $clonefpcremark = $cloneobj->fpc_remark();
359 Function: Get/set the fpc remark for this clone
360 Returns : scalar representing the fpc remark of this clone
361 Args : none to get, OR string to set
367 return $self->{'_fpcremark'} = shift if @_;
368 return $self->{'_fpcremark'};
374 Usage : @clonebands = $cloneobj->bands();
375 Function: Get/set the bands for this clone
376 Returns : liat representing the band of this clone, if
377 readcor = 1 while creating the MapIO object and the
379 Args : none to get, OR string to set
385 return $self->{'_bands'} = shift if @_;
386 return $self->{'_bands'};
392 Usage : $cloneobj->group($chrno);
393 Function: Get/set the group number for this clone.
394 This is a generic term, used for Linkage-Groups as well as for
396 Returns : scalar representing the group number of this clone
397 Args : none to get, OR string to set
403 return $self->{'_group'} = shift if @_;
404 return $self->{'_group'};
410 Usage : my $ctg = $cloneobj->contigid();
411 Function: Get/set the contig this clone belongs to
412 Returns : scalar representing the contig
413 Args : none to get, OR string to set
419 $self->{'_contig'} = shift if @_;
420 return $self->{'_contig'} || 0;
425 Title : each_markerid
426 Usage : @markers = $cloneobj->each_markerid();
427 Function: retrieves all the elements in a map unordered
428 Returns : list of strings (ids)
431 *** This only supplies the ids set with the set_markers method ***
432 *** It has nothing to do with actual Bio::Map::MarkerI objects ***
437 my ($self,$value) = @_;
438 return @
{$self->{"_markers"}};
444 Usage : $obj->set_markers($newval)
445 Function: Set list of Marker ids (arrayref)
447 Args : arrayref of strings (ids)
449 *** This only sets a list of ids ***
450 *** It has nothing to do with actual Bio::Map::MarkerI objects ***
455 my ($self,$markers) = @_;
456 if( defined $markers && ref($markers) =~ /ARRAY/ ) {
457 $self->{'_markers'} = $markers;