File: Species.pm

package info (click to toggle)
libgo-perl 0.13-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,404 kB
  • sloc: perl: 13,104; sh: 21; makefile: 6
file content (54 lines) | stat: -rw-r--r-- 1,196 bytes parent folder | download | duplicates (8)
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
# $Id: Species.pm,v 1.3 2005/06/29 18:40:19 sshu Exp $
#
# This GO module is maintained by Chris Mungall <cjm@fruitfly.org>
#
# see also - http://www.geneontology.org
#          - http://www.godatabase.org/dev
#
# You may distribute this module under the same terms as perl itself

package GO::Model::Species;

=head1 NAME

  GO::Model::Species;

=head1 DESCRIPTION

represents a gene product in a particular species (this will
effectively always be refered to implicitly by the gene symbol even
though a gene may have >1 product)

=cut


use Carp;
use Exporter;
use GO::Utils qw(rearrange);
use GO::Model::Root;
use strict;
use vars qw(@ISA);

@ISA = qw(GO::Model::Root Exporter);

sub _valid_params {
    return qw(id ncbi_taxa_id genus species common_name lineage_string apph);
}

sub from_bpspecies {
    my $class = shift;
    my $species = shift;
    my $division = shift;
    my $taxon = $class->new;
    $taxon->common_name($species->common_name);
    $taxon->genus($species->genus);
    $taxon->species($species->species);
#    $taxon->taxon_code($division) if $division;
    $taxon;
}

sub binomial {
    my $self = shift;
    return ($self->genus || "")." ".($self->species || "");
}