UMLS
Search the Unified Medical Language System (UMLS), for more details visit the REST API.
Searching the UMLS requires approved credentials. You can sign up [here]](https://uts.nlm.nih.gov//license.html)
Import
using BioMedQuery.UMLS
Credentials
#
BioMedQuery.UMLS.Credentials
— Type.
Credentials(user, psswd)
Search the UMLS
#
BioMedQuery.UMLS.search_umls
— Method.
search_umls(c::Credentials, query)
Search UMLS Rest API. For more info see UMLS_API
Arguments
c::Credentials
: UMLS username and passwordquery
: UMLS query containing the search termversion:
Optional - defaults to current
Output
result_pages
: Array, where each entry is a dictionary containing a page of
results. e.g
Dict{AbstractString,Any} with 3 entries:
"pageSize" => 25
"pageNumber" => 1
"result" => Dict{AbstractString,Any}("classType"=>"searchResults","result…
Examples
julia credentials = Credentials(user, psswd) tgt = get_tgt(credentials) term = "obesity" query = Dict("string"=>term, "searchType"=>"exact" ) all_results= search_umls(tgt, query) ```
<a target='_blank' href='https://github.com/bcbi/BioMedQuery.jl/tree/6784d8728ec34959a797e41b8178c17a1243251d/src/UMLS/UMLS.jl#L97-L129' class='documenter-source'>source</a><br>
<a id='Best-match-CUI-1'></a>
## Best match CUI
<a id='BioMedQuery.UMLS.best_match_cui-Tuple{Any}' href='#BioMedQuery.UMLS.best_match_cui-Tuple{Any}'>#</a>
**`BioMedQuery.UMLS.best_match_cui`** — *Method*.
best_match_cui(result_pages)
Retrive the best match from array of all result pages
###Example
```julia
cui = BioMedQuery.UMLS.best_match_cui(all_results)
Semantic types of a CUI
#
BioMedQuery.UMLS.get_semantic_type
— Method.
get_semantic_type(c::Credentials, cui)
Return an array of the semantic types associated with a cui
Example
credentials = Credentials(user, psswd)
tgt = get_tgt(credentials)
cui = "C0028754"
sm = BioMedQuery.UMLS.get_semantic_type(tgt, cui)
Semantic Network Database
#
BioMedQuery.UMLS.populate_net_mysql
— Method.
populate_net_mysql(config; sn_version, mysql_version)
Populate and return a MySQL database with the UMLS Semantic Network Structure
Arguments:
config:Dict()
: Dictionary containing MySQL database informationsn_version
: Version of the Semantic Network (defaults to 2015AB). Available
versions include: 2015AB (planning to include future releases)
mysql_version:
Supported and default version is mysql5_6
Example:
host="localhost"
username="root"
password=""
umls_sn_dbname="umls_sn"
overwrite_db=true
db_config = Dict(:host=>host,
:dbname=>umls_sn_dbname,
:username=>username,
:pswd=>password,
:overwrite=>overwrite_db)
umls_sn_db= populate_net_mysql(db_config)
Schema
The schema of the MySQL database of the semantic network is the following:
Note:
The previous function uses the original scripts that are part of MetamorphoSys (part of the mmsys.zip downloaded here), and the current Relational ASCII (CVS) files for the UMLS Semantic Network (obtained here)
For useful information on loading your Semantic Network files into an Oracle or MySQL database, please consult the on-line documentation at:
http://www.nlm.nih.gov/research/umls/implementation_resources/scripts/index.html