示例clam to transmart loader
claml2transmart的Python项目详细描述
这个包包含一个映射器,它以分类标记语言(clam)格式读取本体。 并将其转换为TranSMART平台的数据模型, 一个用于转化生物医学研究的开源数据共享和分析平台。
它还提供了一个应用映射器并写入转换后的数据的实用程序, 使用transmart-loader标记分隔的文件 可以使用transmart-copy工具将其加载到transmart数据库中。
这些包使用python-claml包读取clam文件。
注:这是一个非常初步的版本,仍在开发中。 可在https://github.com/thehyve/python_claml2transmart/issues报告问题。
安装
这个包需要Python3.6。
要安装claml2transmart,请执行以下操作:
pip install claml2transmart
或来源:
git clone https://github.com/thehyve/python_claml2transmart.git
cd python_claml2transmart
pip install .
使用以下命令运行测试(包括覆盖率):
python setup.py test
用法
以clam格式从xml文件读取本体,并将输出写入transmart copy 格式化为/path/to/output。输出目录应该是 空的不存在(然后它将被创建)。
claml2transmart [--code-prefix] <system> <input.xml> /path/to/output
对于--code_prefix,概念代码用作概念标签的前缀。
示例:icd-10-gm(德国对icd-10的修改)可在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
这将在output目录中生成目录i2b2metadata和i2b2demodata。 生成的数据可以使用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