File: Homol.pm

package info (click to toggle)
libbio-db-gff-perl 1.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,216 kB
  • sloc: perl: 9,976; makefile: 2
file content (101 lines) | stat: -rw-r--r-- 1,957 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
=head1 NAME

Bio::DB::GFF::Homol -- A segment of DNA that is homologous to another

=head1 SYNOPSIS

See L<Bio::DB::GFF>.

=head1 DESCRIPTION

Bio::DB::GFF::Homol is a named subtype of Bio::DB::GFF::Segment.  It
inherits all the methods of its parent, and was created primarily to
allow for isa() queries and for compatibility with
Ace::Sequence::Homol.  

A Homol object is typically returned as the method result of the
Bio::DB::GFF::Feature-E<gt>target() method.

=head1 METHODS

=cut

package Bio::DB::GFF::Homol;
$Bio::DB::GFF::Homol::VERSION = '1.7.4';
use strict;

use base qw(Bio::DB::GFF::Segment);

=head2 name

 Title   : name
 Usage   : $name = $homol->name
 Function: get the ID of the homology object
 Returns : a string
 Args    : none
 Status  : Public

=cut

sub name     { shift->refseq }

=head2 asString

 Title   : asString
 Usage   : $name = $homol->asString
 Function: same as name(), for operator overloading
 Returns : a string
 Args    : none
 Status  : Public

=cut

sub asString { shift->name }


=head2 id

 Title   : id
 Usage   : $id = $homol->id
 Function: get database ID in class:id format
 Returns : a string
 Args    : none
 Status  : Public

=cut

sub id       {
  my $self = shift;
  return "$self->{class}:$self->{name}";
}

sub new_from_segment {
  my $package   = shift;
  $package      = ref $package if ref $package;
  my $segment   = shift;
  my $new = {};
  @{$new}{qw(factory sourceseq start stop strand class ref refstart refstrand)}
    = @{$segment}{qw(factory sourceseq start stop strand class ref refstart refstrand)};
  return bless $new,__PACKAGE__;
}

=head1 BUGS

This module is still under development.

=head1 SEE ALSO

L<bioperl>, L<Bio::DB::GFF>, L<Bio::DB::RelSegment>

=head1 AUTHOR

Lincoln Stein E<lt>lstein@cshl.orgE<gt>.

Copyright (c) 2001 Cold Spring Harbor Laboratory.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;