| 1 | =head1 NAME | ||
| 2 | |||
| 3 | Bio::DB::GFF::Featname -- The name of a feature | ||
| 4 | |||
| 5 | =head1 SYNOPSIS | ||
| 6 | |||
| 7 | use Bio::DB::GFF; | ||
| 8 | |||
| 9 | my $db = Bio::DB::GFF->new( -adaptor => 'dbi:mysql', | ||
| 10 | -dsn => 'dbi:mysql:elegans42'); | ||
| 11 | |||
| 12 | my $feature = Bio::DB::GFF::Featname->new(Locus => 'unc-19'); | ||
| 13 | my $segment = $db->segment($feature); | ||
| 14 | |||
| 15 | =head1 DESCRIPTION | ||
| 16 | |||
| 17 | Bio::DB::GFF::Featname is the name of a feature. It contains two | ||
| 18 | fields: name and class. It is typically used by the Bio::DB::GFF | ||
| 19 | module to denote a group, and is accepted by | ||
| 20 | Bio::DB::Relsegment-E<gt>new() and Bio::DB::GFF-E<gt>segment() as a | ||
| 21 | replacement for the -name and -class arguments. | ||
| 22 | |||
| 23 | =head1 METHODS | ||
| 24 | |||
| 25 | =cut | ||
| 26 | |||
| 27 | package Bio::DB::GFF::Featname; | ||
| 28 | 37 | $Bio::DB::GFF::Featname::VERSION = '1.7.4'; | |
| 29 | 37 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 30 | 37 | ▶ | use base qw(Bio::Root::RootI); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 31 | |||
| 32 | use overload | ||
| 33 | 37 | ▶ | '""' => 'asString', |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 34 | 37 | fallback => 1; | |
| 35 | |||
| 36 | =head2 new | ||
| 37 | |||
| 38 | Title : new | ||
| 39 | Usage : $name = Bio::DB::GFF::Featname->new($class,$name) | ||
| 40 | Function: create a new Bio::DB::GFF::Featname object | ||
| 41 | Returns : a new Bio::DB::GFF::Featname object | ||
| 42 | Args : class and ID | ||
| 43 | Status : Public | ||
| 44 | |||
| 45 | =cut | ||
| 46 | |||
| 47 | 433 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 48 | # use a blessed array for speed | ||
| 49 | 433 | my $pack = shift; | |
| 50 | 433 | bless [@_],$pack; # class,name | |
| 51 | } | ||
| 52 | |||
| 53 | 0 | ▶ | sub _cleanup_methods { return; } |
|
Subroutine
_cleanup_methods: not called CC=1 SCAR=6.9
| |||
| 54 | |||
| 55 | =head2 id | ||
| 56 | |||
| 57 | Title : id | ||
| 58 | Usage : $id = $name->id | ||
| 59 | Function: return a unique ID for the combination of class and name | ||
| 60 | Returns : a string | ||
| 61 | Args : none | ||
| 62 | Status : Public | ||
| 63 | |||
| 64 | This method returns a unique combination of the name and class in the | ||
| 65 | form "class:name". Coincidentally, this is the same format used | ||
| 66 | by AceDB. | ||
| 67 | |||
| 68 | =cut | ||
| 69 | |||
| 70 | 0 | ▶ | sub id { |
|
Subroutine
id: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 71 | 0 | my $self = shift; | |
| 72 | 0 | return join ':',@$self; | |
| 73 | } | ||
| 74 | |||
| 75 | =head2 name | ||
| 76 | |||
| 77 | Title : name | ||
| 78 | Usage : $name = $name->name | ||
| 79 | Function: return the name of the Featname | ||
| 80 | Returns : a string | ||
| 81 | Args : none | ||
| 82 | Status : Public | ||
| 83 | |||
| 84 | =cut | ||
| 85 | |||
| 86 | 2066 | ▶ | sub name { shift->[1] } |
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
documented
| |||
| 87 | |||
| 88 | =head2 class | ||
| 89 | |||
| 90 | Title : class | ||
| 91 | Usage : $class = $name->class | ||
| 92 | Function: return the name of the Featname | ||
| 93 | Returns : a string | ||
| 94 | Args : none | ||
| 95 | Status : Public | ||
| 96 | |||
| 97 | =cut | ||
| 98 | |||
| 99 | 670 | ▶ | sub class { shift->[0] } |
|
Subroutine
class: called CC=1 SCAR=0.0
Pod
documented
| |||
| 100 | |||
| 101 | =head2 asString | ||
| 102 | |||
| 103 | Title : asString | ||
| 104 | Usage : $string = $name->asString | ||
| 105 | Function: same as name() | ||
| 106 | Returns : a string | ||
| 107 | Args : none | ||
| 108 | Status : Public | ||
| 109 | |||
| 110 | This method is used to overload the "" operator. It is equivalent to | ||
| 111 | calling name(). | ||
| 112 | |||
| 113 | =cut | ||
| 114 | |||
| 115 | 2066 | ▶ | sub asString { shift->name } |
|
Subroutine
asString: called CC=1 SCAR=0.0
Pod
documented
| |||
| 116 | |||
| 117 | =head2 clone | ||
| 118 | |||
| 119 | Title : clone | ||
| 120 | Usage : $new_clone = $type->clone; | ||
| 121 | Function: clone this object | ||
| 122 | Returns : a new Bio::DB::GFF::Featname object | ||
| 123 | Args : none | ||
| 124 | Status : Public | ||
| 125 | |||
| 126 | This method creates an exact copy of the object. | ||
| 127 | |||
| 128 | =cut | ||
| 129 | |||
| 130 | 107 | ▶ | sub clone { |
|
Subroutine
clone: called CC=1 SCAR=0.0
Pod
documented
| |||
| 131 | 107 | my $self = shift; | |
| 132 | 107 | return bless [@$self],ref $self; | |
| 133 | } | ||
| 134 | |||
| 135 | =head1 BUGS | ||
| 136 | |||
| 137 | This module is still under development. | ||
| 138 | |||
| 139 | =head1 SEE ALSO | ||
| 140 | |||
| 141 | L<bioperl>, L<Bio::DB::GFF>, L<Bio::DB::RelSegment> | ||
| 142 | |||
| 143 | =head1 AUTHOR | ||
| 144 | |||
| 145 | Lincoln Stein E<lt>lstein@cshl.orgE<gt>. | ||
| 146 | |||
| 147 | Copyright (c) 2001 Cold Spring Harbor Laboratory. | ||
| 148 | |||
| 149 | This library is free software; you can redistribute it and/or modify | ||
| 150 | it under the same terms as Perl itself. | ||
| 151 | |||
| 152 | =cut | ||
| 153 | |||
| 154 | 37 | 1; | |