BioPerl
view release on metacpan or search on metacpan
Bio/Map/FPCMarker.pm view on Meta::CPAN
return $self->{'_subgroup'} || 0;
}
=head2 position
Title : position
Usage : $markerpos = $markerobj->position($ctg);
Function: get the position of the marker in the contig
Returns : scalar representing the position of the markernumber of
the contig
Args : $ctg is necessary to look for the position of the marker
in that contig.
*** This has nothing to do with an actual Bio::Map::PositionI object ***
=cut
sub position {
my ($self,$ctg) = @_;
return 0 unless defined $ctg;
return 0 unless( defined $self->{'_position'} &&
defined $self->{'_position'}{$ctg});
return $self->{'_position'}{$ctg};
}
=head2 remark
Title : remark
Usage : $markerremark = $markerobj->remark();
Function: get the remarks for this marker
Returns : scalar of newline-separated markers
Args : none
=cut
sub remark {
my ($self) = shift;
return $self->{'_remark'} = shift if @_;
return $self->{'_remark'};
}
=head2 each_cloneid
Title : each_cloneid
Usage : my @clones = $map->each_cloneid();
Function: retrieves all the clone ids in a map unordered
Returns : list of strings (ids)
Args : none
*** This only supplies the ids set with the set_clones method ***
*** It has nothing to do with actual Bio::Map::MappableI objects ***
=cut
sub each_cloneid {
my ($self) = @_;
return $self->_each_element('clones');
}
=head2 each_contigid
Title : each_contigid
Usage : my @contigs = $map->each_contigid();
Function: retrieves all the contig ids in a map unordered
Returns : list of strings (ids)
Args : none
*** This only supplies the ids set with the set_contigs method ***
*** It has nothing to do with actual Bio::Map::MapI objects ***
=cut
sub each_contigid {
my ($self) = @_;
return $self->_each_element('contigs');
}
sub _each_element{
my ($self, $type) = @_;
$type = 'clones' unless defined $type;
$type = lc("_$type");
return keys %{$self->{$type} || {}};
}
=head2 set_clones
Title : set_clones
Usage : $marker->set_clones(\%clones)
Function: Set the clone ids hashref
Returns : None
Args : Hashref of clone ids
*** This only sets a hash of ids ***
*** It has nothing to do with actual Bio::Map::MappableI objects ***
=cut
sub set_clones{
my ($self,$clones) = @_;
if( defined $clones && ref($clones) =~ /HASH/ ) {
$self->{'_clones'} = $clones;
}
}
=head2 set_contigs
Title : set_contigs
Usage : $marker->set_contigs(\%contigs)
Function: Set the contig ids hashref
Returns : None
Args : Hashref of contig ids
*** This only sets a hash of ids ***
*** It has nothing to do with actual Bio::Map::MapI objects ***
=cut
sub set_contigs{
my ($self,$contigs) = @_;
if( defined $contigs && ref($contigs) =~ /HASH/ ) {
$self->{'_contigs'} = $contigs;
}
}
=head2 set_positions
Title : set_positions
Usage : $marker->set_positions(\%markerpos)
Function: Set the positions hashref
Returns : None
Args : Hashref of marker positions
( run in 0.547 second using v1.01-cache-2.11-cpan-5735350b133 )