3 # BioPerl module for Bio::Map::fpcmarker
5 # Cared for by Gaurav Gupta <gaurav@genome.arizona.edu>
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::FPCMarker - An central map object representing a marker
19 # get the marker object of $marker from the Bio::Map::FPCMarker
20 my $markerobj = $physical->get_markerobj($marker);
22 # acquire all the clones that hit this marker
23 foreach my $clone ($markerobj->each_cloneid()) {
27 # find the position of this marker in $contig
28 print "Position in contig $contig"," = ",$markerobj->position($contig),
31 # find the group of the marker
32 print "Group : ",$markerobj->group();
35 See L<Bio::Map::Position> and L<Bio::Map::PositionI> for more information.
39 This object handles the notion of a marker.
40 This object is intended to be used by a map parser like fpc.pm.
46 User feedback is an integral part of the evolution of this and other
47 Bioperl modules. Send your comments and suggestions preferably to
48 the Bioperl mailing list. Your participation is much appreciated.
50 bioperl-l@bioperl.org - General discussion
51 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
55 Report bugs to the Bioperl bug tracking system to help us keep track
56 of the bugs and their resolution. Bug reports can be submitted via the
59 http://bugzilla.open-bio.org/
61 =head1 AUTHOR - Gaurav Gupta
63 Email gaurav@genome.arizona.edu
67 Sendu Bala bix@sendu.me.uk
69 =head1 PROJECT LEADERS
71 Jamie Hatfield jamie@genome.arizona.edu
72 Dr. Cari Soderlund cari@genome.arizona.edu
74 =head1 PROJECT DESCRIPTION
76 The project was done in Arizona Genomics Computational Laboratory (AGCoL)
77 at University of Arizona.
79 This work was funded by USDA-IFAFS grant #11180 titled "Web Resources for
80 the Computation and Display of Physical Mapping Data".
82 For more information on this project, please refer:
83 http://www.genome.arizona.edu
87 The rest of the documentation details each of the object methods.
88 Internal methods are usually preceded with a _
92 # Let the code begin...
94 package Bio
::Map
::FPCMarker
;
96 use Bio
::Map
::Position
;
99 use base
qw(Bio::Root::Root Bio::Map::MappableI);
104 Usage : my $clone = Bio::Map::FPCMarker->new
111 -subgroup=> $subgroup,
114 -contigs => \%contigs,
115 -position => \%markerpos,
119 Function: Initialize a new Bio::Map::FPCMarker object
120 Most people will not use this directly but get Markers
121 through L<Bio::MapIO::fpc>
122 Returns : L<Bio::Map::FPCMarker> object
123 Args : -name => marker name string,
124 -type => type string,
125 -global => global position for marker,
126 -frame => boolean if marker is framework or placement,
127 -group => group number for marker,
128 -subgroup => subgroup number of marker,
129 -anchor => boolean if marker is anchored,
130 -clones => all the clone elements in map (hashref),
131 -contigs => all the contig elements (hasref),
132 -position => mapping of marker names to map position (hasref),
133 -remark => remarks, separated by newlines
138 my ($class,@args) = @_;
139 my $self= $class->SUPER::new
(@args);
141 my ($name,$type,$global,$frame,$group,
142 $subgroup, $anchor, $clones,$contigs,
143 $positions, $remark) = $self->_rearrange([qw(NAME TYPE GLOBAL FRAME
144 GROUP SUBGROUP ANCHOR
145 CLONES CONTIGS POSITIONS REMARK)],@args);
147 $self->name($name) if defined $name;
148 $self->type($type) if defined $type;
149 $self->global($global) if defined $global;
150 $self->group($group) if defined $group;
151 $self->subgroup($group) if defined $subgroup;
152 $self->anchor($anchor) if defined $anchor;
153 $self->remark($remark) if defined $remark;
155 $self->set_clones($clones) if defined $clones;
156 $self->set_contigs($contigs) if defined $contigs;
157 $self->set_positions($positions) if defined $positions;
162 =head1 Access Methods
164 These methods let you get and set the member variables
169 Usage : my $name = $markerobj->name();
170 Function: Get/set the name for this marker
171 Returns : scalar representing the current name of this marker
172 Args : none to get, OR string to set
178 return $self->{'_name'} = shift if @_;
179 return $self->{'_name'};
185 Usage : my $type = $markerobj->type();
186 Function: Get/set the type for this marker
187 Returns : scalar representing the current type of this marker
188 Args : none to get, OR string to set
194 return $self->{'_type'} = shift if @_;
195 return $self->{'_type'};
201 Usage : my $type = $markerobj->global();
202 Function: Get/set the global position for this marker
203 Returns : scalar representing the current global position of this marker
204 Args : none to get, OR string to set
210 return $self->{'_global'} = shift if @_;
211 return $self->{'_global'};
217 Usage : my $anchor = $markerobj->anchor();
218 Function: indicate if the Marker is anchored or not (True | False)
219 Returns : scalar representing the anchor (1 | 0) for this marker
220 Args : none to get, OR 1|0 to set
226 return $self->{'_anchor'} = shift if @_;
227 return $self->{'_anchor'};
233 Usage : $frame = $markerobj->framework();
234 Function: indicate if the Marker is framework or placement (1 | 0)
235 Returns : scalar representing if the marker is framework
236 (1 if framework, 0 if placement)
237 Args : none to get, OR 1|0 to set
243 return $self->{'_frame'} = shift if @_;
244 return $self->{'_frame'};
250 Usage : $grpno = $markerobj->group();
251 Function: Get/set the group number for this marker. This is a generic term,
252 used for Linkage-Groups as well as for Chromosomes.
253 Returns : scalar representing the group number of this marker
254 Args : none to get, OR string to set
260 $self->{'_group'} = shift if @_;
261 return $self->{'_group'} || 0;
267 Usage : $subgroup = $marker->subgroup();
268 Function: Get/set the subgroup for this marker. This is a generic term:
269 subgroup here could represent subgroup of a Chromosome or of a
270 Linkage Group. The user must take care of which subgroup he/she is
272 Returns : scalar representing the subgroup of this marker
273 Args : none to get, OR string to set
279 $self->{'_subgroup'} = shift if @_;
280 return $self->{'_subgroup'} || 0;
286 Usage : $markerpos = $markerobj->position($ctg);
287 Function: get the position of the marker in the contig
288 Returns : scalar representing the position of the markernumber of
290 Args : $ctg is necessary to look for the position of the marker
293 *** This has nothing to do with an actual Bio::Map::PositionI object ***
298 my ($self,$ctg) = @_;
299 return 0 unless defined $ctg;
301 return 0 unless( defined $self->{'_position'} &&
302 defined $self->{'_position'}{$ctg});
303 return $self->{'_position'}{$ctg};
309 Usage : $markerremark = $markerobj->remark();
310 Function: get the remarks for this marker
311 Returns : scalar of newline-separated markers
318 return $self->{'_remark'} = shift if @_;
319 return $self->{'_remark'};
325 Usage : my @clones = $map->each_cloneid();
326 Function: retrieves all the clone ids in a map unordered
327 Returns : list of strings (ids)
330 *** This only supplies the ids set with the set_clones method ***
331 *** It has nothing to do with actual Bio::Map::MappableI objects ***
337 return $self->_each_element('clones');
342 Title : each_contigid
343 Usage : my @contigs = $map->each_contigid();
344 Function: retrieves all the contig ids in a map unordered
345 Returns : list of strings (ids)
348 *** This only supplies the ids set with the set_contigs method ***
349 *** It has nothing to do with actual Bio::Map::MapI objects ***
355 return $self->_each_element('contigs');
359 my ($self, $type) = @_;
361 $type = 'clones' unless defined $type;
362 $type = lc("_$type");
364 return keys %{$self->{$type} || {}};
370 Usage : $marker->set_clones(\%clones)
371 Function: Set the clone ids hashref
373 Args : Hashref of clone ids
375 *** This only sets a hash of ids ***
376 *** It has nothing to do with actual Bio::Map::MappableI objects ***
381 my ($self,$clones) = @_;
382 if( defined $clones && ref($clones) =~ /HASH/ ) {
383 $self->{'_clones'} = $clones;
390 Usage : $marker->set_contigs(\%contigs)
391 Function: Set the contig ids hashref
393 Args : Hashref of contig ids
395 *** This only sets a hash of ids ***
396 *** It has nothing to do with actual Bio::Map::MapI objects ***
401 my ($self,$contigs) = @_;
402 if( defined $contigs && ref($contigs) =~ /HASH/ ) {
403 $self->{'_contigs'} = $contigs;
409 Title : set_positions
410 Usage : $marker->set_positions(\%markerpos)
411 Function: Set the positions hashref
413 Args : Hashref of marker positions
415 *** This only sets a hash of numbers ***
416 *** It has nothing to do with actual Bio::Map::PositionI objects ***
421 my ($self,$pos) = @_;
422 if( defined $pos && ref($pos) =~ /HASH/ ) {
423 $self->{'_positions'} = $pos;