AliasAnalysisTable of Contents

Alias Analysis ModuleIntroductionThe Alias TablePublic MethodsAliasTypesFindFormatHtmlTypeAlias Analysis ModuleIntroductionThis module encapsulates data about aliases. For each alias, it tells us how to generat the appropriate link, what the type is for the alias, its export format, and its displa format. To add new alias types, we simply update this package.

An alias has three forms. The internal form is how the alias is stored in the database The export form is the form into which it should be translated when being exported t BRC databases. The natural form is the form it takes in its own environment. Fo example, gi|15675083 is the internal form of a GenBank ID. Its export form i NCBI_gi:15675083, and its natural form is simply 15675083.

The Alias TableThe alias table is a hash of hashes. Each sub-hash relates to a specific type of alias, an the key names the alias type (e.g. uniprot, KEGG). The sub-hashes have three fields.

patternThis is a regular expression that will match aliases of the specified type in their interna forms.

convertThis field is a hash of conversions. The key for each is the conversion type and th data is a replacement expression. These replacement expressions rely on the pattern matc having just taken place and use the $1, $2, ... variables to get text from th alias's internal form. An alias's natural form, export form, and URL are all implemented a different types of conversions. New conversion types can be created a will be updating the table without having to worry about changing any code. Note that fo the URL conversion, a value of undef means no URL is available.

normalizeThis is a prefix that can be used to convert an alias from its natural form to it internal form.

At some point the Alias Table may be converted from an inline hash to an external XML file.

Public MethodsAliasTypesmy @aliasTypes = AliasAnalysis::AliasTypes();

Return a list of the alias types. The list can be used to create a menu or dropdow for selecting a preferred alias.

Findmy $aliasFound = AliasAnalysis::Find($type, \@aliases);

Find the first alias of the specified type in the list.

typeType of alias desired. This must be one of the keys in %AliasTable.

aliasesReference of a list containing alias names. The first alias name that matche the structure of the specified alias type will be returned. The incomin aliases are presumed to be in internal form.

RETURNReturns the natural form of the desired alias, or undef if no alias o the specified type could be found.

Typemy $naturalName = AliasAnalysis::Type($type => $name);

Return the natural name of an alias if it is of the specified type, and undef otherwise Note that the result of this method will be TRUE if the alias is an internal form of the name type and FALSE otherwise.

typeRelevant alias type.

nameInternal-form alias to be matched to the specified type.

RETURNReturns the natural form of the alias if it is of the specified type, and undef otherwise.

FormatHtmlmy $htmlText = AliasAnalysis::FormatHtml(@aliases);

Create an html string that contains the specified aliases in a comma-separated lis with hyperlinks where available. The aliases are expected to be in internal form an will stay that way.

aliasesA list of aliases in internal form that are to be formatted into HTML.

RETURNReturns a string containing the aliases in a comma-separated list, with hyperlink present on those for which hyperlinks are available.