Skip to main content

Shared Data API

Project description

immport-client

Unofficial ImmPort Python client generated via OpenAPI Generator Some patches for missspecifications have been manually applied to the ImmPort API, when methods actually returned arrays instead of single objects.

Overview

The Shared Data API supports the downloading of data hosted in the ImmPort Shared Data Warehouse. Endpoints that download Study and Subject level data require Authorization to use these endpoints. Registration to use ImmPort Shared Data is free, visit ImmPort to explore the types of data available for download. Click on this Link to register.

Additional Help

For more details on the endpoints visit the API Documentation Site for more information. In addition, How-To tutorials on using the endpoints and examples of exploring the data are available here

Note

The Swagger UI can be used to try out endpoints but the Browser can freeze when the endpoint returns large result sets. Either try to add filters to reduce the amount of data returned or test the endpoints with shell scripts using curl or wget.

Controllers

Controller Description Authorization
Study Search Endpoints to support text and facted search of Study and Subject Metadata No
Study Data These endpoints support the retrieval of study data for a single study including subject, experiment, etc Yes
Study Result Endpoints to download study, experiment, assay results Yes
Study File Manifest These endpoints support retrieving a manifest of all files associated with a given study Yes
Download Study Files These endpoints support the download of study package files including release files, study files, protocol files and result files using GA4GH DRS ID's. Use the manifest endpoint to retrieve DRS ID for each file Yes
Lookup or Controlled Vocabulary Endpoints to download controlled vocabulary information No

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v1
  • Package version: 1.0.0
  • Generator version: 7.21.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://immport.org

Requirements.

Python 3.9+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import immport_client

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import immport_client

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import os
import immport_client

from immport_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://immport.org/data/query
# See configuration.py for a list of all supported configuration parameters.
configuration = immport_client.Configuration(
    host = "https://immport.org/data/query"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]


# Enter a context with an instance of the API client
with immport_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = immport_client.DownloadStudyFilesApi(api_client)
    file_uuid = '81944983-0aaf-4b55-a1ef-e2681c8b258b' # str | DRS file UUID
    access_method = 's3' # str | Access method to retrieve the file: s3 or stream

    try:
        # Get download URL using DRS ID
        api_response = api_instance.get_url_from_drs(file_uuid, access_method)
        print("The response of DownloadStudyFilesApi->get_url_from_drs:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DownloadStudyFilesApi->get_url_from_drs: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://immport.org/data/query

Class Method HTTP request Description
DownloadStudyFilesApi get_url_from_drs GET /drs/download/{accessMethod}/{fileUUID} Get download URL using DRS ID
LookupOrControlledVocabularyApi get_lk_adverse_event_severity GET /api/lookup/lkAdverseEventSeverity Retrieve LkAdverseEventSeverity Information
LookupOrControlledVocabularyApi get_lk_age_event GET /api/lookup/lkAgeEvent Retrieve LkAgeEvent Information
LookupOrControlledVocabularyApi get_lk_analyte GET /api/lookup/lkAnalyte Retrieve LkAnalyte Information
LookupOrControlledVocabularyApi get_lk_ancestral_population GET /api/lookup/lkAncestralPopulation Retrieve LkAncestralPopulation Information
LookupOrControlledVocabularyApi get_lk_cell_population GET /api/lookup/lkCellPopulation Retrieve LkCellPopulation Information
LookupOrControlledVocabularyApi get_lk_cell_population_marker GET /api/lookup/lkCellPopulationMarker Retrieve LkCellPopulationMarker Information
LookupOrControlledVocabularyApi get_lk_compound_role GET /api/lookup/lkCompoundRole Retrieve LkCompoundRole Information
LookupOrControlledVocabularyApi get_lk_criterion_category GET /api/lookup/lkCriterionCategory Retrieve LkCriterionCategory Information
LookupOrControlledVocabularyApi get_lk_data_completeness GET /api/lookup/lkDataCompleteness Retrieve LkDataCompleteness Information
LookupOrControlledVocabularyApi get_lk_disease GET /api/lookup/lkDisease Retrieve LkDisease Information
LookupOrControlledVocabularyApi get_lk_disease_stage GET /api/lookup/lkDiseaseStage Retrieve LkDiseaseStage Information
LookupOrControlledVocabularyApi get_lk_ethnicity GET /api/lookup/lkEthnicity Retrieve LkEthnicity Information
LookupOrControlledVocabularyApi get_lk_exp_measurement_tech GET /api/lookup/lkExpMeasurementTech Retrieve LkExpMeasurementTech Information
LookupOrControlledVocabularyApi get_lk_exposure_material GET /api/lookup/lkExposureMaterial Retrieve LkExposureMaterial Information
LookupOrControlledVocabularyApi get_lk_exposure_process GET /api/lookup/lkExposureProcess Retrieve LkExposureProcess Information
LookupOrControlledVocabularyApi get_lk_expsample_result_schema GET /api/lookup/lkExpsampleResultSchema Retrieve LkExpsampleResultSchema Information
LookupOrControlledVocabularyApi get_lk_file_detail GET /api/lookup/lkFileDetail Retrieve LkFileDetail Information
LookupOrControlledVocabularyApi get_lk_gender GET /api/lookup/lkSex Retrieve LkSex Information
LookupOrControlledVocabularyApi get_lk_hmdb GET /api/lookup/lkHmdb Retrieve LkHmdb Information
LookupOrControlledVocabularyApi get_lk_lab_test_name GET /api/lookup/lkLabTestName Retrieve LkLabTestName Information
LookupOrControlledVocabularyApi get_lk_lab_test_panel_name GET /api/lookup/lkLabTestPanelName Retrieve LkLabTestPanelName Information
LookupOrControlledVocabularyApi get_lk_locus_name GET /api/lookup/lkLocusName Retrieve LkLocusName Information
LookupOrControlledVocabularyApi get_lk_mass_spectrometry_type GET /api/lookup/lkMassSpectrometryType Retrieve LkMassSpectrometryType Information
LookupOrControlledVocabularyApi get_lk_organization GET /api/lookup/lkOrganization Retrieve LkOrganization Information
LookupOrControlledVocabularyApi get_lk_personnel_role GET /api/lookup/lkPersonnelRole Retrieve LkPersonnelRole Information
LookupOrControlledVocabularyApi get_lk_plate_type GET /api/lookup/lkPlateType Retrieve LkPlateType Information
LookupOrControlledVocabularyApi get_lk_protein_name GET /api/lookup/lkProteinName Retrieve LkProteinName Information
LookupOrControlledVocabularyApi get_lk_protocol_type GET /api/lookup/lkProtocolType Retrieve LkProtocolType Information
LookupOrControlledVocabularyApi get_lk_public_repository GET /api/lookup/lkPublicRepository Retrieve LkPublicRepository Information
LookupOrControlledVocabularyApi get_lk_race GET /api/lookup/lkRace Retrieve LkRace Information
LookupOrControlledVocabularyApi get_lk_reagent_type GET /api/lookup/lkReagentType Retrieve LkReagentType Information
LookupOrControlledVocabularyApi get_lk_research_focus GET /api/lookup/lkResearchFocus Retrieve LkResearchFocus Information
LookupOrControlledVocabularyApi get_lk_sample_type GET /api/lookup/lkSampleType Retrieve LkSampleType Information
LookupOrControlledVocabularyApi get_lk_source_type GET /api/lookup/lkSourceType Retrieve LkSourceType Information
LookupOrControlledVocabularyApi get_lk_species GET /api/lookup/lkSpecies Retrieve LkSpecies Information
LookupOrControlledVocabularyApi get_lk_study_file_type GET /api/lookup/lkStudyFileType Retrieve LkStudyFileType Information
LookupOrControlledVocabularyApi get_lk_study_panel GET /api/lookup/lkStudyPanel Retrieve LkStudyPanel Information
LookupOrControlledVocabularyApi get_lk_subject_location GET /api/lookup/lkSubjectLocation Retrieve LkSubjectLocation Information
LookupOrControlledVocabularyApi get_lk_t0_event GET /api/lookup/lkT0Event Retrieve LkT0Event Information
LookupOrControlledVocabularyApi get_lk_time_unit GET /api/lookup/lkTimeUnit Retrieve LkTimeUnit Information
LookupOrControlledVocabularyApi get_lk_transcript_type GET /api/lookup/lkTranscriptType Retrieve LkTranscriptType Information
LookupOrControlledVocabularyApi get_lk_unit_of_measure GET /api/lookup/lkUnitOfMeasure Retrieve LkUnitOfMeasure Information
LookupOrControlledVocabularyApi get_lk_user_role_type GET /api/lookup/lkUserRoleType Retrieve LkUserRoleType Information
LookupOrControlledVocabularyApi get_lk_virus_strain GET /api/lookup/lkVirusStrain Retrieve LkVirusStrain Information
LookupOrControlledVocabularyApi get_lk_visibility_category GET /api/lookup/lkVisibilityCategory Retrieve LkVisibilityCategory Information
StudyDataApi get_all_file_details_api GET /api/study/filePath/{studyAccession} Retrieve All File Path Information
StudyDataApi get_protocol_file_details_api GET /api/study/filePath/protocolFiles/{studyAccession} Retrieve Protocol File Path Information
StudyDataApi get_restricted_study_accessions GET /api/study/getRestrictedStudyAccessions
StudyDataApi get_result_file_details_api GET /api/study/filePath/resultFiles/{studyAccession} Retrieve Result File Path Information
StudyDataApi get_study GET /api/study/{studyAccession} Retrieve Basic Study Information
StudyDataApi get_study_adverse_event_api GET /api/study/adverseEvent/{studyAccession} Retrieve Study Adverse Event Information
StudyDataApi get_study_arm_api GET /api/study/arm/{studyAccession} Retrieve Study Arm Information
StudyDataApi get_study_condition_or_disease GET /api/study/condition/{studyAccession} Retrieve Study ConditionOrDisease
StudyDataApi get_study_contract_program GET /api/study/contract/{studyAccession} Retrieve Study Contract and Program Information
StudyDataApi get_study_experiment_api GET /api/study/experiment/{studyAccession} Retrieve Study Experiments
StudyDataApi get_study_file_api GET /api/study/file/{studyAccession} Retrieve Study File Information
StudyDataApi get_study_file_details_api GET /api/study/filePath/studyFiles/{studyAccession} Retrieve Study File Path Information
StudyDataApi get_study_immune_exposure_api GET /api/study/immuneExposure/{studyAccession} Retrieve Study Subject Immune Exposure Information
StudyDataApi get_study_inclusion_exclusion_api GET /api/study/inclusionExclusion/{studyAccession} Retrieve Study Inclusion/Exclusion critera
StudyDataApi get_study_intervention_api GET /api/study/intervention/{studyAccession} Retrieve Study Subject Intervention Information
StudyDataApi get_study_link GET /api/study/link/{studyAccession} Retrieve Study Links
StudyDataApi get_study_personnel GET /api/study/personnel/{studyAccession} Retrieve Study Personnel Information
StudyDataApi get_study_planned_visit GET /api/study/plannedVisit/{studyAccession} Retrieve Planned Visit Information
StudyDataApi get_study_protocol GET /api/study/protocol/{studyAccession} Retrieve Protocol Information
StudyDataApi get_study_pubmed GET /api/study/pubmed/{studyAccession} Retrieve Pubmed Information
StudyDataApi get_study_subject_assessment_api GET /api/study/assessment/{studyAccession} Retrieve Study Subject Assessments
StudyDataApi get_study_subject_bio_sample_api GET /api/study/biosample/{studyAccession} Retrieve Study Subject BioSample Information
StudyDataApi get_study_subject_demographic_api GET /api/study/demographic/{studyAccession} Retrieve Study Subject Demographics
StudyDataApi get_study_subject_exp_sample_api GET /api/study/expsample/{studyAccession} Retrieve Study Subject ExpSample Information
StudyDataApi get_study_subject_lab_test_api GET /api/study/labtest/{studyAccession} Retrieve Study Subject Lab Tests
StudyDataApi get_study_summary GET /api/study/summary/{studyAccession}
StudyFileManifestApi get_file_details GET /api/study/manifest/{studyAccession} Retrieve file manifest with DRS ID's for a study
StudyResultApi get_elisa_result GET /result/elisa Retrieve ELISA results using filters
StudyResultApi get_elispot_result GET /result/elispot Retrieve Elispot results using filters
StudyResultApi get_fcs_analyzed_result GET /result/fcsAnalyzed Retrieve FcsAnalyzed results using filters
StudyResultApi get_file_path GET /result/filePath Retrieve File Paths using filters
StudyResultApi get_hai_result GET /result/hai Retrieve HAI results using filters
StudyResultApi get_hla_typing_result GET /result/hlaTyping Retrieve HLA Typing results using filters
StudyResultApi get_kir_typing_result GET /result/kirTyping Retrieve kIR Typing results using filters
StudyResultApi get_mass_spectrometry_result GET /result/massSpectrometryResult Retrieve Mass Spectrometry results using filters
StudyResultApi get_mbaa_result GET /result/mbaa Retrieve MBAA results using filters
StudyResultApi get_neut_ab_titer_result GET /result/neutAbTiter Retrieve Neutralizing Antibody Titer results using filters
StudyResultApi get_pcr_result GET /result/pcr Retrieve PCR results using filters
StudySearchApi study_search GET /api/search/study Search studies
StudySearchApi subject_search GET /api/search/subject Search subjects

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

immport-security

Author

ImmPort_Helpdesk@immport.org

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

immport_client-1.0.0.tar.gz (118.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

immport_client-1.0.0-py3-none-any.whl (282.4 kB view details)

Uploaded Python 3

File details

Details for the file immport_client-1.0.0.tar.gz.

File metadata

  • Download URL: immport_client-1.0.0.tar.gz
  • Upload date:
  • Size: 118.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for immport_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7683da1ba03351d0dd9076e3549314c7b17203c553e71a7f27307de7dd86f06b
MD5 ff0f60cc66fee1e9c8abfa32fdffebea
BLAKE2b-256 d5608f0010b98a95bc9f1e8d6c6b063ed90c965e0c2ddea54bbcf903093ce8c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for immport_client-1.0.0.tar.gz:

Publisher: publish-to-pypi.yml on chillerb/immport-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file immport_client-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: immport_client-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 282.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for immport_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aabb1ee66e4cccd9c82a9ba98fe1aa988d80f3539836e74d9faa462307cbf123
MD5 204460fbe24cab60c37e66fbed39aa83
BLAKE2b-256 2cb11603017cbae6626565cf18c1cae10ff03efda840f16e476f44366c639298

See more details on using hashes here.

Provenance

The following attestation bundles were made for immport_client-1.0.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on chillerb/immport-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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