UMLSQuery - A module to query a umls mysql installation
use UMLSQuery;
my $U = new UMLSQuery;
$U->init( u => 'username',
p => 'password',
h => 'hostname',
dbname => 'umls');
$U->getCUI(string/aui/sui/lui, sab=>)
$U->getAUI(string/cui/sui/lui, sab=>)
$U->getSTR(string/cui/aui/sui/lui, sab=>)
$U->getSAB(string/cui/aui/sui/lui)
$U->mapToId(phrase, idtype=>cui/lui/sui/aui, sab=>)
$U->getParents(aui/cui, rela=>, sab=>)
$U->getCommonParent(aui/cui, aui/cui, rela=>, sab=>)
$U->getChildren(aui/cui, rela=> sab=>)
$U->getCommonChild(aui/cui, aui/cui, rela=>, sab=>)
$U->getDistBF(cui_1, cui_2,rela=>)
$U->getAvailableSAB()
$U->finish()
This module will allow you to connect to a mysql UMLS installation and run common queries. If you have a query that you want, contact me at nigam@stanford.edu.
$U->getCUI('prostate', sab=>'SNOMEDCT')
$U->getAUI('prostate', sab=>'SNOMEDCT')
$U->getSTR('A0812060', sab=>'SNOMEDCT')
getSAB(string/cui/aui/sui/lui)
$U->getSAB('prostate')
$U->mapToId('intraductal carcinoma of prostate', idtype=>'cui', sab=>'SNOMEDCT');
The function returns a hash which has a particular permutation as its key and the value is an array of pairs of id - string. The above examle returns:
key id string
------------------------------
carcinoma C0007097 Carcinoma
intraductal C1644197 Intraductal
prostate C0033572 Prostate
carcinoma prostate C0600139 Carcinoma prostate
intraductal carcinoma C0007124 Intraductal carcinoma
prostate carcinoma C0600139 Prostate carcinoma
carcinoma of prostate C0600139 Carcinoma of prostate
in case of mutliple matches, the id - string pair will be pushed onto the array.
$U->getParents('C0600139', rela=>'isa');
The function returns a hash, where the keys are the direct parents of the id and the values are the ids forming the path to the root node. The ids are always reported as aui. The example above returns:
direct parent Path to the root
---------------------------------------------------
A3407646 A3684559.A3713095.A3506985.A3407646
$U->getCommonParent('C0600139','C0007124');
The function returns the common parent (aui) and the distance (dist) from the query nodes. The above example returns:
aui dist
-------------------------------------------------------
A0689089 4 links from C0600139 3 links from C0007124
$U->getChildren('C0376358',rela=>'isa');
The function returns a hash, where the keys are the direct children of the id and the values is the query id. The ids are reported in the form of the query id. The example above returns:
child parent
------------------------
C0347001 C0376358
C1330959 C0376358
C1302530 C0376358
C1282482 C0376358
$U->getCommonChild('C0376358','C0346554')
The function returns the common child and the ids of the query nodes. The example above returns
C0600139 common child of C0376358 and C0346554
$U->getDistBF('C0600139','C0007124')
The above example returns 2.
$U->getAvailableSAB('SNOMED')
It returns:
sab description
-------------------------------------------------
SNOMEDCT SNOMED Clinical Terms, 2006_01_31
SCTSPA SNOMED Clinical Terms, Spanish Language Edition, 2005_10_31
SNM SNOMED-2, 2
SNMI SNOMED International, 1998
finish()