2 # BioPerl module for Bio::Map::fpcmarker
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Gaurav Gupta <gaurav@genome.arizona.edu>
8 # Copyright Gaurav Gupta
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::Map::FPCMarker - An central map object representing a marker
20 # get the marker object of $marker from the Bio::Map::FPCMarker
21 my $markerobj = $physical->get_markerobj($marker);
23 # acquire all the clones that hit this marker
24 foreach my $clone ($markerobj->each_cloneid()) {
28 # find the position of this marker in $contig
29 print "Position in contig $contig"," = ",$markerobj->position($contig),
32 # find the group of the marker
33 print "Group : ",$markerobj->group();
36 See L<Bio::Map::Position> and L<Bio::Map::PositionI> for more information.
40 This object handles the notion of a marker.
41 This object is intended to be used by a map parser like fpc.pm.
47 User feedback is an integral part of the evolution of this and other
48 Bioperl modules. Send your comments and suggestions preferably to
49 the Bioperl mailing list. Your participation is much appreciated.
51 bioperl-l@bioperl.org - General discussion
52 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
56 Please direct usage questions or support issues to the mailing list:
58 I<bioperl-l@bioperl.org>
60 rather than to the module maintainer directly. Many experienced and
61 reponsive experts will be able look at the problem and quickly
62 address it. Please include a thorough description of the problem
63 with code and data examples if at all possible.
67 Report bugs to the Bioperl bug tracking system to help us keep track
68 of the bugs and their resolution. Bug reports can be submitted via the
71 https://github.com/bioperl/bioperl-live/issues
73 =head1 AUTHOR - Gaurav Gupta
75 Email gaurav@genome.arizona.edu
79 Sendu Bala bix@sendu.me.uk
81 =head1 PROJECT LEADERS
83 Jamie Hatfield jamie@genome.arizona.edu
84 Dr. Cari Soderlund cari@genome.arizona.edu
86 =head1 PROJECT DESCRIPTION
88 The project was done in Arizona Genomics Computational Laboratory (AGCoL)
89 at University of Arizona.
91 This work was funded by USDA-IFAFS grant #11180 titled "Web Resources for
92 the Computation and Display of Physical Mapping Data".
94 For more information on this project, please refer:
95 http://www.genome.arizona.edu
99 The rest of the documentation details each of the object methods.
100 Internal methods are usually preceded with a _
104 # Let the code begin...
106 package Bio
::Map
::FPCMarker
;
108 use Bio
::Map
::Position
;
111 use base
qw(Bio::Root::Root Bio::Map::MappableI);
116 Usage : my $clone = Bio::Map::FPCMarker->new
123 -subgroup=> $subgroup,
126 -contigs => \%contigs,
127 -position => \%markerpos,
131 Function: Initialize a new Bio::Map::FPCMarker object
132 Most people will not use this directly but get Markers
133 through L<Bio::MapIO::fpc>
134 Returns : L<Bio::Map::FPCMarker> object
135 Args : -name => marker name string,
136 -type => type string,
137 -global => global position for marker,
138 -frame => boolean if marker is framework or placement,
139 -group => group number for marker,
140 -subgroup => subgroup number of marker,
141 -anchor => boolean if marker is anchored,
142 -clones => all the clone elements in map (hashref),
143 -contigs => all the contig elements (hasref),
144 -position => mapping of marker names to map position (hasref),
145 -remark => remarks, separated by newlines
150 my ($class,@args) = @_;
151 my $self= $class->SUPER::new
(@args);
153 my ($name,$type,$global,$frame,$group,
154 $subgroup, $anchor, $clones,$contigs,
155 $positions, $remark) = $self->_rearrange([qw(NAME TYPE GLOBAL FRAME
156 GROUP SUBGROUP ANCHOR
157 CLONES CONTIGS POSITIONS REMARK)],@args);
159 $self->name($name) if defined $name;
160 $self->type($type) if defined $type;
161 $self->global($global) if defined $global;
162 $self->group($group) if defined $group;
163 $self->subgroup($group) if defined $subgroup;
164 $self->anchor($anchor) if defined $anchor;
165 $self->remark($remark) if defined $remark;
167 $self->set_clones($clones) if defined $clones;
168 $self->set_contigs($contigs) if defined $contigs;
169 $self->set_positions($positions) if defined $positions;
174 =head1 Access Methods
176 These methods let you get and set the member variables
181 Usage : my $name = $markerobj->name();
182 Function: Get/set the name for this marker
183 Returns : scalar representing the current name of this marker
184 Args : none to get, OR string to set
190 return $self->{'_name'} = shift if @_;
191 return $self->{'_name'};
197 Usage : my $type = $markerobj->type();
198 Function: Get/set the type for this marker
199 Returns : scalar representing the current type of this marker
200 Args : none to get, OR string to set
206 return $self->{'_type'} = shift if @_;
207 return $self->{'_type'};
213 Usage : my $type = $markerobj->global();
214 Function: Get/set the global position for this marker
215 Returns : scalar representing the current global position of this marker
216 Args : none to get, OR string to set
222 return $self->{'_global'} = shift if @_;
223 return $self->{'_global'};
229 Usage : my $anchor = $markerobj->anchor();
230 Function: indicate if the Marker is anchored or not (True | False)
231 Returns : scalar representing the anchor (1 | 0) for this marker
232 Args : none to get, OR 1|0 to set
238 return $self->{'_anchor'} = shift if @_;
239 return $self->{'_anchor'};
245 Usage : $frame = $markerobj->framework();
246 Function: indicate if the Marker is framework or placement (1 | 0)
247 Returns : scalar representing if the marker is framework
248 (1 if framework, 0 if placement)
249 Args : none to get, OR 1|0 to set
255 return $self->{'_frame'} = shift if @_;
256 return $self->{'_frame'};
262 Usage : $grpno = $markerobj->group();
263 Function: Get/set the group number for this marker. This is a generic term,
264 used for Linkage-Groups as well as for Chromosomes.
265 Returns : scalar representing the group number of this marker
266 Args : none to get, OR string to set
272 $self->{'_group'} = shift if @_;
273 return $self->{'_group'} || 0;
279 Usage : $subgroup = $marker->subgroup();
280 Function: Get/set the subgroup for this marker. This is a generic term:
281 subgroup here could represent subgroup of a Chromosome or of a
282 Linkage Group. The user must take care of which subgroup he/she is
284 Returns : scalar representing the subgroup of this marker
285 Args : none to get, OR string to set
291 $self->{'_subgroup'} = shift if @_;
292 return $self->{'_subgroup'} || 0;
298 Usage : $markerpos = $markerobj->position($ctg);
299 Function: get the position of the marker in the contig
300 Returns : scalar representing the position of the markernumber of
302 Args : $ctg is necessary to look for the position of the marker
305 *** This has nothing to do with an actual Bio::Map::PositionI object ***
310 my ($self,$ctg) = @_;
311 return 0 unless defined $ctg;
313 return 0 unless( defined $self->{'_position'} &&
314 defined $self->{'_position'}{$ctg});
315 return $self->{'_position'}{$ctg};
321 Usage : $markerremark = $markerobj->remark();
322 Function: get the remarks for this marker
323 Returns : scalar of newline-separated markers
330 return $self->{'_remark'} = shift if @_;
331 return $self->{'_remark'};
337 Usage : my @clones = $map->each_cloneid();
338 Function: retrieves all the clone ids in a map unordered
339 Returns : list of strings (ids)
342 *** This only supplies the ids set with the set_clones method ***
343 *** It has nothing to do with actual Bio::Map::MappableI objects ***
349 return $self->_each_element('clones');
354 Title : each_contigid
355 Usage : my @contigs = $map->each_contigid();
356 Function: retrieves all the contig ids in a map unordered
357 Returns : list of strings (ids)
360 *** This only supplies the ids set with the set_contigs method ***
361 *** It has nothing to do with actual Bio::Map::MapI objects ***
367 return $self->_each_element('contigs');
371 my ($self, $type) = @_;
373 $type = 'clones' unless defined $type;
374 $type = lc("_$type");
376 return keys %{$self->{$type} || {}};
382 Usage : $marker->set_clones(\%clones)
383 Function: Set the clone ids hashref
385 Args : Hashref of clone ids
387 *** This only sets a hash of ids ***
388 *** It has nothing to do with actual Bio::Map::MappableI objects ***
393 my ($self,$clones) = @_;
394 if( defined $clones && ref($clones) =~ /HASH/ ) {
395 $self->{'_clones'} = $clones;
402 Usage : $marker->set_contigs(\%contigs)
403 Function: Set the contig ids hashref
405 Args : Hashref of contig ids
407 *** This only sets a hash of ids ***
408 *** It has nothing to do with actual Bio::Map::MapI objects ***
413 my ($self,$contigs) = @_;
414 if( defined $contigs && ref($contigs) =~ /HASH/ ) {
415 $self->{'_contigs'} = $contigs;
421 Title : set_positions
422 Usage : $marker->set_positions(\%markerpos)
423 Function: Set the positions hashref
425 Args : Hashref of marker positions
427 *** This only sets a hash of numbers ***
428 *** It has nothing to do with actual Bio::Map::PositionI objects ***
433 my ($self,$pos) = @_;
434 if( defined $pos && ref($pos) =~ /HASH/ ) {
435 $self->{'_positions'} = $pos;