NAME
ws-getShortestPath
SYNOPSIS
Basic Usuage
perl ws-getShortestPath.pl --verbose 1 -sources SNOMEDCT,MSH --rels PAR --dirs U --config configfilename --login loginfile --patterns patternsfile --testfile test_file
--verbose: Sets verbose flag to true if value is set to 1, and thus displays all the authentication information for the user.
--sources : UMLS sources can be specified by providing list of sources seperated by comma. These sources will be used to query and retrieve the information.
--rels : UMLS relations can be specified by providing list of relations seperated by comma. These relations will be used to query and retrieve the information.
--dirs : Directions for UMLS relations can be specified by providing list of directions seperated by comma. Different directions are U - Up , D - Down and H - Horizontal. These directions will be used to find the allowable path. The sequence of these directions should be same as the sequence of relations provided by the --rels option.
--config : Instead of providing sources, relations and directions on command line, they can be specified using a configuration file, which can be provided with this option. It takes complete path and name of the file. The config file is expected in following format:
--login : User can specify login credentials through the file, which should be of form:
--patterns : User can specify the set of allowable patterns that should be used while calculating an allowable path. This options accepts a regex inside a file specified by patternsfile.
The regex may be of form :
/\b1+\b|\b1+2+\b|\b1+3+\b|\b1+3+2+\b|\b2+\b|\b2+3+\b|\b3+2+\b|\b3+\b/
1 : upward arrow
2: downward arrow
3: Horizontal arrow
Each regex is seperated from another using | (or). Each regex represents one allowed pattern from the set.
Right now, the vector length of any size is allowed in the allowed direction,
For example,
\b1+\b : means a path which consists of one or more than one upward arrows is allowed.
Follwing is a sample output
- Enter username to connect to UMLSKS:mchoudhari
- Enter password:
- Enter first query CUI:C0229962
- Enter second query CUI:C1623497
- UMLS Source(s) used: SNOMED-CT
- UMLS Relation(s) used: PAR
- Source is : C0229962, Destination is: C1623497
- path is->Body part (C0229962)->Body Regions (C0005898)->Anatomic structures (C0700276)->Physical anatomical entity (C0506706)->Body structure (C1268086)->SNOMED CT (C1623497) C1879289 C1616556
- Enter first query CUI:stop
DESCRIPTION
This program authenticates user by asking for valid username and password to connect to UMLSKS. Once the user is authenticated program takes two terms from the user and finds the shortest path (semantic distance) between those two concepts using the heirarchical structure of the UMLSKS Metathesaurus database. The program queries SNOMED-CT database with the CUIs user enters and displays the shortest path along with the concepts through which the two inputs are connected. It also displays the UMLS relations and sources used to find the path.
Modules/Packages
This program uses following packages:
- package GetNeighbors
-
sub GetNeighbors::read_object which reads hash reference object passed to this sub and fetches the required Neighbors' information.
sub GetNeighbors::format_object calls appropriate functions like format_homogenous_hash, format_scalar, format_homogenous_array depending on the object reference it is called with. format_homogenous_hash,format_scalar and format_homogenous_array are subroutines which read the objects they are called with and fetch the desired information.
- package ConnectUMLS
-
sub ConnectUMLS::get_pt to get the proxy ticket using a web service.
sub ConnectUMLS::connect_umls to connect to UMLS by sending username and password and getting back a proxy ticket.
- package ValidateTerm
-
sub ValidateCUI::validateTerm to accepts an input and validates it for as valid or invalid CUI or a term.
- package GetUserData
-
sub GetUserData::getUserDetails to get username and password from the user.
- package Query
-
sub Query::runQuery which takes method name, service and other parameters as argument and calls the web service. It also displays the information received from the web service and other error messages.
- package MakeGraph
-
sub MakeGraph::form_graph forms graph using standard BFS algorithm and creates a graph using the concepts and their neighbor concepts. It finds shortest path between two input concepts and displays the path.
SEE ALSO
ValidateCUI.pm GetUserData.pm Query.pm ConnectUMLS.pm GetParents.pm FindPaths.pm
AUTHORS
Mugdha Choudhari University of Minnesota Duluth <chou0130 at d.umn.edu>
Ted Pedersen, University of Minnesota Duluth <tpederse at d.umn.edu>
COPYRIGHT
Copyright (C) 2010, Mugdha Choudhari, Ted Pedersen
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.