Skip to main content

Example ClaML to TranSMART loader

Project description

Build status codecov PyPI PyPI - Downloads

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, using transmart-loader, 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


The package requires Python 3.6.

To install claml2transmart, do:

pip install claml2transmart

Or from source:

git clone
cd python_claml2transmart
pip install .

Run tests (including coverage) with:

python test


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 [--code-prefix] <system> <input.xml> /path/to/output

With --code_prefix, the concept code is used as prefix for the concept label.

Example: the ICD-10-GM (German modification of ICD-10) is available at

# Unzip and navigate to the classification directory
mkdir icd10gm2019syst-claml
cd icd10gm2019sys-claml
unzip ../
# create an output directory
mkdir output
# apply the mapping
claml2transmart 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 -o transmart-copy.jar
# Load data
PGUSER=tm_cz PGPASSWORD=tm_cz java -jar transmart-copy.jar -d output


This project was funded by the German Ministry of Education and Research (BMBF) as part of the project DIFUTURE - Data Integration for Future Medicine within the German Medical Informatics Initiative (grant no. 01ZZ1804D).


Copyright (c) 2019 The Hyve B.V.

The ClaML ontology to TranSMART loader is licensed under the MIT License. See the file LICENSE.

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

claml2transmart-0.1.5.tar.gz (5.5 kB view hashes)

Uploaded source

Built Distribution

claml2transmart-0.1.5-py3-none-any.whl (7.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page