NAME
UMLS::Association - A suite of Perl modules that implement a number of semantic association measures in order to calculate the semantic association between two concepts in the UMLS.
SYNOPSIS
INSTALL
To install the module, run the following magic commands:
perl Makefile.PL
make
make test
make install
This will install the module in the standard location. You will, most probably, require root privileges to install in standard system directories. To install in a non-standard directory, specify a prefix during the 'perl Makefile.PL' stage as:
perl Makefile.PL PREFIX=/home/sid
It is possible to modify other parameters during installation. The details of these can be found in the ExtUtils::MakeMaker documentation. However, it is highly recommended not messing around with other parameters, unless you know what you're doing.
DESCRIPTION
This package provides a Perl interface to
DATABASE SETUP
The interface assumes that the CUI network extracted from the MetaMapped Medline Baseline is present in a mysql database. The name of the database can be passed as configuration options at initialization. However, if the names of the databases are not provided at initialization, then default value is used -- the database is called 'CUI_BIGRAMS'.
The CUI_BIGRAMS database must contain four? tables: 1. N11 2. N1P 3. NP1 4. NPP
All other tables in the databases will be ignored, and any of these tables missing would raise an error.
A script explaining how to create the CUI network and the mysql database are in the INSTALL file.
INITIALIZING THE MODULE
To create an instance of the interface object, using default values for all configuration options:
use UMLS::Association;
my $associaton = UMLS::Association->new();
Database connection options can be passed through the my.cnf file. For example: [client] user = <username> password = <password> port = 3306 socket = /tmp/mysql.sock database = mmb
Or through the by passing the connection information when first instantiating an instance. For example:
$associaton = UMLS::Association->new({"driver" => "mysql",
"database" => "$database",
"username" => "$username",
"password" => "$password",
"hostname" => "$hostname",
"socket" => "$socket"});
'driver' -> Default value 'mysql'. This option specifies the Perl
DBD driver that should be used to access the
database. This implies that the some other DBMS
system (such as PostgresSQL) could also be used,
as long as there exist Perl DBD drivers to
access the database.
'database' -> Default value 'CUI_BIGRAM'. This option specifies the name
of the database.
'hostname' -> Default value 'localhost'. The name or the IP address
of the machine on which the database server is
running.
'socket' -> Default value '/tmp/mysql.sock'. The socket on which
the database server is using.
'port' -> The port number on which the database server accepts
connections.
'username' -> Username to use to connect to the database server. If
not provided, the module attempts to connect as an
anonymous user.
'password' -> Password for access to the database server. If not
provided, the module attempts to access the server
without a password.
More information is provided in the INSTALL file.
PARAMETERS
You can also pass other parameters which controls the functionality of the Association.pm module.
$assoc = UMLS::Association->new({"measure" => "lch"});
'measure' -> This modifies the association measure
FUNCTION DESCRIPTIONS
exists
description:
function to check if a concept ID exists in the database.
input:
$concept <- string containing a cui
output:
1 | 0 <- integers indicating if the cui exists
example:
use UMLS::Association;
my $umls = UMLS::Association->new();
my $concept = "C0018563";
if($umls->exists($concept)) {
print "$concept exists\n";
}
getFrequency
description:
function returns the frequency of a given concept pair
input:
$concept1 <- cui
$concept2 <- cui
output:
$frequency <- number
example:
use UMLS::Association;
my $associator = UMLS::Association->new();
my $freq = $mmb->getFrequency($concept1, $concept2)
calculateStatistic
description:
function returns the given statistical score of a given concept pair
input:
$concept1 <- cui
$concept2 <- cui
$measure <- statistical measure
output:
$score <- float
example:
use UMLS::Association;
my $associator = UMLS::Association->new();
my $stat = $associator->calculateStatistic($concept1, $concept2, $measure)
getParents
description:
returns the parents of a concept - the relations that are considered parents
are predefined by the user in the configuration file. The default is the PAR
relation.
input:
$concept <- string containing cui
output:
$array <- reference to an array containing a list of cuis
example:
use UMLS::Association;
my $umls = UMLS::Association->new();
my $concept = "C0018563";
my $parents = $umls->getParents($concept);
print "The parents of $concept are:\n";
foreach my $parent (@{$parents}) { print " $parent\n"; }
getChildren
description:
returns the children of a concept - the relations that are considered children
are predefined by the user in the configuration file. The default is the CHD
relation.
input:
$concept <- string containing cui
output:
$array <- reference to an array containing a list of cuis
example:
use UMLS::Association;
my $umls = UMLS::Association->new();
my $concept = "C0018563";
my $children = $umls->getChildren($concept);
print "The children of $concept are:\n";
foreach my $child (@{$children}) { print " $child\n"; }
REFERENCING
If you write a paper that has used UMLS-Association in some way, we'd certainly be grateful if you sent us a copy. Currently we have no paper referrencing the package hopefully we will soon.
SEE ALSO
http://search.cpan.org/dist/UMLS-Association
AUTHOR
Bridget T McInnes <btmcinnes@vcu.edu>
COPYRIGHT
Copyright (c) 2015
Bridget T. McInnes, Virginia Commonwealth University
btmcinnes at vcu.edu
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to
The Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.