Merge pull request #181 from bioperl/limit-dockerhub-trigger
[bioperl-live.git] / Bio / DB / GFF / Homol.pm
blob70cd1017fddbc40d84f55e86db57e6c8506d7716
1 =head1 NAME
3 Bio::DB::GFF::Homol -- A segment of DNA that is homologous to another
5 =head1 SYNOPSIS
7 See L<Bio::DB::GFF>.
9 =head1 DESCRIPTION
11 Bio::DB::GFF::Homol is a named subtype of Bio::DB::GFF::Segment. It
12 inherits all the methods of its parent, and was created primarily to
13 allow for isa() queries and for compatibility with
14 Ace::Sequence::Homol.
16 A Homol object is typically returned as the method result of the
17 Bio::DB::GFF::Feature-E<gt>target() method.
19 =head1 METHODS
21 =cut
23 package Bio::DB::GFF::Homol;
24 use strict;
26 use base qw(Bio::DB::GFF::Segment);
28 =head2 name
30 Title : name
31 Usage : $name = $homol->name
32 Function: get the ID of the homology object
33 Returns : a string
34 Args : none
35 Status : Public
37 =cut
39 sub name { shift->refseq }
41 =head2 asString
43 Title : asString
44 Usage : $name = $homol->asString
45 Function: same as name(), for operator overloading
46 Returns : a string
47 Args : none
48 Status : Public
50 =cut
52 sub asString { shift->name }
55 =head2 id
57 Title : id
58 Usage : $id = $homol->id
59 Function: get database ID in class:id format
60 Returns : a string
61 Args : none
62 Status : Public
64 =cut
66 sub id {
67 my $self = shift;
68 return "$self->{class}:$self->{name}";
71 sub new_from_segment {
72 my $package = shift;
73 $package = ref $package if ref $package;
74 my $segment = shift;
75 my $new = {};
76 @{$new}{qw(factory sourceseq start stop strand class ref refstart refstrand)}
77 = @{$segment}{qw(factory sourceseq start stop strand class ref refstart refstrand)};
78 return bless $new,__PACKAGE__;
81 =head1 BUGS
83 This module is still under development.
85 =head1 SEE ALSO
87 L<bioperl>, L<Bio::DB::GFF>, L<Bio::DB::RelSegment>
89 =head1 AUTHOR
91 Lincoln Stein E<lt>lstein@cshl.orgE<gt>.
93 Copyright (c) 2001 Cold Spring Harbor Laboratory.
95 This library is free software; you can redistribute it and/or modify
96 it under the same terms as Perl itself.
98 =cut