Example ClaML to TranSMART loader
Project description
This package contains a mapper that reads ontologies in Classification Markup Language (ClaML) format and translates them to the data model of the TranSMART platform, an open source data sharing and analytics platform for translational biomedical research.
It also provides a utility that applies the mapper and writes the translated data to tab-separated files that can be loaded into a TranSMART database using the transmart-copy tool.
The packages uses the python-claml package for reading ClaML files.
⚠️ Note: this is a very preliminary version, still under development. Issues can be reported at https://github.com/thehyve/python_claml2transmart/issues.
Installation
The package requires Python 3.6.
To install claml2transmart, do:
pip install claml2transmart
Or from source:
git clone https://github.com/thehyve/python_claml2transmart.git
cd python_claml2transmart
pip install .
Run tests (including coverage) with:
python setup.py test
Usage
Read ontology from an XML file in ClaML format and write the output in transmart-copy format to /path/to/output. The output directory should be empty of not existing (then it will be created).
claml2transmart <system> <input.xml> /path/to/output
Example: the ICD-10-GM (German modification of ICD-10) is available at icd10gm2019syst-claml.zip.
# Unzip and navigate to the classification directory
mkdir icd10gm2019syst-claml
cd icd10gm2019sys-claml
unzip ../icd10gm2019syst-claml.zip
# create an output directory
mkdir output
# apply the mapping
claml2transmart http://dimdi.de/icd10gm2019 Klassifikationsdateien/icd10gm2019syst_claml_20180921.xml output
This generates the directories i2b2metadata and i2b2demodata in the output directory. The generated data can be loaded using transmart-copy:
# Download transmart-copy:
curl -f -L https://repo.thehyve.nl/service/local/repositories/releases/content/org/transmartproject/transmart-copy/17.1-HYVE-5.9-RC3/transmart-copy-17.1-HYVE-5.9-RC3.jar -o transmart-copy.jar
# Load data
PGUSER=tm_cz PGPASSWORD=tm_cz java -jar transmart-copy.jar -d output
License
Copyright (c) 2019, The Hyve
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 3 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, see <https://www.gnu.org/licenses/>.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for claml2transmart-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae808c9d74ef552071a1564f9c3090c6e47c6310e8f3fd4aa3c95b7983e793a1 |
|
MD5 | 22119f92030433c97a27a37694b8634a |
|
BLAKE2b-256 | b9a7c97b02bbff89c433c01616a35dd8d52d16985ec6c842440319b7a989d30d |