forked from thehyve/transmart-api-client-py
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Installable and importable as 'transmart'
- Loading branch information
Showing
9 changed files
with
779 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
.ipynb_checkpoints | ||
*.pyc | ||
.idea/ | ||
*.ipynb | ||
__pycache__/ | ||
build/ | ||
dist/ | ||
transmart.egg-info/ | ||
transmart/__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
The tranSMART API Training given on [2015 tranSMART Foundation Annual Meeting in Amsterdam](http://transmartfoundation.org/2015-annual-meeting/) | ||
|
||
The Python part of this training is in this branch meant to work with Python 3.x. | ||
The python client created for that project has now been recovered to work with version 2 of the tranSMART API. | ||
|
||
This is meant to work with Python 3.x only. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
protobuf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import setuptools | ||
import os | ||
import re | ||
|
||
|
||
VERSIONFILE=os.path.join('transmart', '__init__.py') | ||
verstrline = open(VERSIONFILE, "rt").read() | ||
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" | ||
mo = re.search(VSRE, verstrline, re.M) | ||
if mo: | ||
version_string = mo.group(1) | ||
else: | ||
raise RuntimeError("Unable to find version string in {}.".format(VERSIONFILE,)) | ||
|
||
with open("requirements.txt", 'r') as f: | ||
required_packages = f.read().splitlines() | ||
|
||
if os.environ.get('READTHEDOCS') == 'True': | ||
for dependency in ['pandas']: | ||
for package in required_packages: | ||
if package.startswith(dependency): | ||
required_packages.remove(package) | ||
|
||
|
||
setuptools.setup( | ||
name="transmart", | ||
version=version_string, | ||
url="https://www.github.com/thehyve/transmart-api-client-py/", | ||
|
||
maintainer="[email protected]", | ||
maintainer_email="[email protected]", | ||
|
||
description="An python client for communicating with the transmart rest api.", | ||
long_description=open('README.md').read(), | ||
|
||
packages=setuptools.find_packages(exclude=['tests', 'tests.*']), | ||
include_package_data=True, | ||
|
||
keywords=['transmart', 'rest', 'api', 'data', 'science'], | ||
|
||
download_url='https://github.com/thehyve/transmart-api-client-py/tarball/{}/'.format(version_string), | ||
|
||
install_requires=required_packages, | ||
|
||
classifiers=[ | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"""tmtk - A toolkit for ETL curation for the tranSMART data warehouse.""" | ||
|
||
from .transmart_api import TransmartApi | ||
from . import utils | ||
|
||
__version__ = "0.1.0" | ||
__author__ = 'The Hyve' | ||
__all__ = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Copyright 2014 Janssen Research & Development, LLC. | ||
// | ||
// This file is part of REST API: transMART's plugin exposing tranSMART's | ||
// data via an HTTP-accessible RESTful API. | ||
// | ||
// 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, along with the following terms: | ||
// | ||
// 1. You may convey a work based on this program in accordance with | ||
// section 5, provided that you retain the above notices. | ||
// 2. You may convey verbatim copies of this program code as you receive | ||
// it, in any medium, provided that you retain the above notices. | ||
// | ||
// 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 <http://www.gnu.org/licenses/>. | ||
|
||
|
||
package highdim; | ||
|
||
option java_package = "org.transmartproject.rest.protobuf"; | ||
option java_outer_classname = "HighDimProtos"; | ||
|
||
//command to compile this file, from the transmart-rest-api base folder: | ||
//protoc --java_out=src/java src/protobuf/highdim/highdim.proto | ||
message HighDimHeader { | ||
|
||
repeated Assay assay = 1; | ||
repeated ColumnSpec columnSpec = 2; | ||
} | ||
|
||
message ColumnSpec { | ||
enum ColumnType { DOUBLE = 1; STRING = 2; } | ||
|
||
required string name = 1; | ||
required ColumnType type = 2; | ||
} | ||
|
||
message Assay { | ||
required int64 assayId = 1; | ||
required string patientId = 2; | ||
optional string sampleTypeName = 3; | ||
optional string timepointName = 4; | ||
optional string tissueTypeName = 5; | ||
optional string platform = 6; | ||
optional string sampleCode = 7; | ||
} | ||
|
||
// One Row per bioMarker/label | ||
message Row { | ||
required string label = 1; | ||
optional string bioMarker = 2; | ||
// A ColumnValue per column (as given by the used projection). | ||
// For single-column projections such as zscore/default_real/etc this has only one entry. | ||
// Each ColumnValue has a corresponding ColumnSpec entry in the header. | ||
repeated ColumnValue value = 3; | ||
} | ||
|
||
message ColumnValue { | ||
// Only ONE of these should be set! | ||
// The type that is set must correspond to that indicated in the corresponding ColumnType for this column in the header. | ||
// Every value corresponds to one assay (matching the order in the header), there are as many values as there are assays | ||
repeated double doubleValue = 1 [packed=true]; | ||
repeated string stringValue = 2; | ||
} |
Oops, something went wrong.