[Bio] / Sprout / SHDrugSearch.pm Repository:
ViewVC logotype

Diff of /Sprout/SHDrugSearch.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Wed Nov 15 22:34:50 2006 UTC revision 1.6, Mon Dec 11 19:50:05 2006 UTC
# Line 44  Line 44 
44    
45  # Table of drug topic category codes.  # Table of drug topic category codes.
46  my %CodeTable = (  my %CodeTable = (
47                   'ES'   => 'essential',                   'ES'   => 'Essential',
48                   'ES-X' => 'essential, determined by experiment',                   'ES-X' => 'Essential',
49                   'ES-L' => 'essential, from the literature',                   'ES-L' => 'Essential',
50                   'KA-T' => 'known Antibiotic target',                   'KA-T' => 'Antibiotic Target',
51                   'KA-I' => 'known Antibiotic Inhibitor',                   'KA-I' => 'Antibiotic Inhibitor',
52                   'VA'   => 'virulence associated',                   'VA'   => 'Virulence Associated',
53                   'VA-K' => 'known virulence associated',                   'VA-K' => 'Virulence Associated',
54                   'VA-P' => 'putative virulence assocated'                   'VA-P' => 'Virulence Assocated',
55                     'TX-K' => 'Toxin',
56                     'TX-B' => 'Toxin',
57                     'SA-A' => 'Surface Associated',
58                     'SA-P' => 'Surface Associated',
59                     'SA-S' => 'Surface Associated',
60                     'SA'   => 'Surface Associated',
61                     'SE-P' => 'Secreted Protein',
62                     'SE'   => 'Secreted Protein',
63                  );                  );
64    
65    =head3 GetCategory
66    
67    C<< my $description = SHDrugSearch::GetCategory($code); >>
68    
69    Return the description of the specified category code.
70    
71    =over 4
72    
73    =item code
74    
75    Category code to convert.
76    
77    =item RETURN
78    
79    Returns the description of the specified category code, as taken from the C<CodeTable> hash.
80    
81    =back
82    
83    =cut
84    
85    sub GetCategory {
86        # Get the parameters.
87        my ($code) = @_;
88        # Convert to upper case.
89        my $catCode = uc $code;
90        # Trim spaces.
91        $catCode =~ s/\s+//g;
92        # Extract it from the hash table.
93        my $retVal = $CodeTable{$catCode};
94        # Check for a not-found condition.
95        if (! $retVal) {
96            $retVal = "Unknown Code $catCode";
97        }
98        # Return the result.
99        return $retVal;
100    }
101    
102  =head2 Virtual Methods  =head2 Virtual Methods
103    
104  =head3 Form  =head3 Form

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3