--- SHDrugSearch.pm 2006/11/15 22:34:50 1.4 +++ SHDrugSearch.pm 2006/11/28 21:50:59 1.5 @@ -44,16 +44,61 @@ # Table of drug topic category codes. my %CodeTable = ( - 'ES' => 'essential', - 'ES-X' => 'essential, determined by experiment', - 'ES-L' => 'essential, from the literature', - 'KA-T' => 'known Antibiotic target', - 'KA-I' => 'known Antibiotic Inhibitor', - 'VA' => 'virulence associated', - 'VA-K' => 'known virulence associated', - 'VA-P' => 'putative virulence assocated' + 'ES' => 'Essential', + 'ES-X' => 'Essential, determined by experiment', + 'ES-L' => 'Essential, from the literature', + 'KA-T' => 'Known Antibiotic Target', + 'KA-I' => 'Known Antibiotic Inhibitor', + 'VA' => 'Virulence Associated', + 'VA-K' => 'Known Virulence Associated', + 'VA-P' => 'Putative Virulence Assocated', + 'TX-K' => 'Known Toxin', + 'TX-B' => 'Putative Anti-Toxin Target', + 'SA-A' => 'Known Antigenic Protein', + 'SA-P' => 'Surface Associated', + 'SA-S' => 'Surface Associated', + 'SA' => 'Surface Associated', + 'SE-P' => 'Putative Secreted Protein', + 'SE' => 'Secreted Protein', ); +=head3 GetCategory + +C<< my $description = SHDrugSearch::GetCategory($code); >> + +Return the description of the specified category code. + +=over 4 + +=item code + +Category code to convert. + +=item RETURN + +Returns the description of the specified category code, as taken from the C hash. + +=back + +=cut + +sub GetCategory { + # Get the parameters. + my ($code) = @_; + # Convert to upper case. + my $catCode = uc $code; + # Trim spaces. + $catCode =~ s/\s+//g; + # Extract it from the hash table. + my $retVal = $CodeTable{$catCode}; + # Check for a not-found condition. + if (! $retVal) { + $retVal = "Unknown Code $catCode"; + } + # Return the result. + return $retVal; +} + =head2 Virtual Methods =head3 Form