A Guide to Integrating the Orpheus API Using Orpheus Python SDK

Researchers in the healthcare domain face challenges in accessing up-to-date and accurate biomedical information. Wisecube addresses this issue by granting drug developers and researchers access to precise healthcare data through the Orpheus API.

With the help of a massive biomedical knowledge graph and semantic AI, Orpheus API provides an interface to up-to-date and relevant information in biomedicine. The Orpheus biomedical knowledge graph contains billions of biomedical facts backed by extensive biomedical datasets and cited references. 

Orpheus Python SDK offers easier and faster access to the Orpheus API. The Python SDK, with its straightforward syntax, enables developers to develop robust Python applications aimed at biomedical research. The precise insights into biomedical facts enable streamlined drug discovery and innovative research. Furthermore, when accessed through Python SDK to develop healthcare applications, Orpheus API empowers experts to uncover groundbreaking discoveries. 

Let’s explore the step-by-step approach to integrating Orpheus API using Orpheus Python SDK. We will also discuss the benefits of integrating Orpheus API in Python applications.

Getting Started with the Orpheus API

Before you begin, ensure you have a Python environment on your machine or a cloud-based IDE – if you’re using one. Orpheus API uses GraphQL for data access. However, when using Python SDK to make API calls, GraphQL knowledge isn’t required. 

You’ll need to request a unique API key to use the API to make data requests. The API key restricts unauthorized API requests, making it secure for you and your users.

Getting an API Key

Orpheus API request process is simple. All you need to do is fill out the API request form with your email address and the purpose of the API request. You’ll get your unique API key after you submit the form.

Installing Orpheus Python SDK

Using the Orpheus Python SDK to communicate with the Orpheus API starts with installing Python SDK in your Python environment. You can follow the steps below once you’ve created your Python project files:

1. Install Wisecube Python SDK from GitHub by running the following command in your terminal:

pip install git+https://github.com/wisecubeai/wisecube-python-sdk

2. Import the WisecubeClient class in your Python console by running the following code:

from src import WisecubeClient

Using Orpheus API in Python SDK

Wisecube Python SDK has a straightforward syntax for interacting with Wisecube AI services. Once you’ve received your API key and created an instance, all you have to do is authenticate your API key and make API requests according to your requirements.

Authenticating API Key

Authenticating your unique API key involves creating an instance of the WisecubeClient client.

Copy the following command in your Python console and replace ‘api_key’ with your API key to authenticate it.

auth_client = WisecubeClient(‘api_key’)

Making API Requests

Once your API key is authenticated, you can make API calls to access the biomedical data from the Orpheus API. This involves calling the Python SDK methods/ API endpoints with suitable parameters. 

For instance, the `.qa()` method requests summary information for a specific question, including relevant documents. For example:

auth_client.client.qa(“Which proteins participate in the formation of the ryanodine receptor quaternary macromolecular complex?”)

In the snippet above, we use client.qa() on our WisecubeClient instance to retrieve relevant summary information by providing a biomedical question. 

Understanding Orpheus API

The Wisecube Python SDK offers nine API endpoints for accessing the Wisecube biomedical knowledge graph. All endpoints serve a unique purpose, which is highlighted in the table below:

Image Source

All methods or APIs mentioned in the table require parameters to make the API request. For example, we provided a question in string format in the qa() method above. Since using another data type instead of a string will result in an error, it is important to call the API with suitable parameters.

Parameter Requirements of each API

Below are the parameter requirements for each API call with examples:

1. QA

.qa()returns summary information for the question passed as a parameter. This summary also includes relevant documents linked to the question.

Parameters

  • Question (String): The input must be a question you want to answer.

Example

auth_client.client.qa(question)

2. Documents

The .documents() API call returns insights and relevant documents related to the question.

Parameters

  • Question (String): The input must be a question to get the documents.

Example

auth_client.client.documents(question)

3. Search Graph

As the name suggests, the .search_graph() API call returns results in the form of a subgraph containing nodes and edges.

Parameters

  • GraphIds ([String]): The input must be a list of IDs, including the ID of the starting node in the graph.
  • MaxNeighbors(Int): Represented by nr: optional variable, default is 10. It indicates the maximum number of neighbor nodes to retrieve.

Example

auth_client.client.search_graph(graphIds, nr=20)

4. Search Text

.search_text() returns a list of entities related to the search term.

Parameters

  • SearchText (String): The string you want to search.

Example

auth_client.client.search_text(searchText)

5. Advanced Search

.advanced_search() returns the entities retrieved from the Wikidata database based on the provided query to fulfill the advanced biomedical research requirements.

Parameters

  • Query (String): Advanced search query.

Example

auth_client.client.advancedSearch(query)

6. Predicate Graph

.getPredicates()API returns information about predicates linked to a given label.

Parameters

  • Labels (String): Represents the label of a predicate.

Example

auth_api_client.getPredicates(labels)

7. Execute Vector Function

.executeVectorFunction() API returns vector embeddings for the given entities. 

Parameters

  • GraphIds [String]: Variable used to specify a list of graph IDs.

Example

auth_api_client.executeVectorFunction(graphIds)

8. Execute Score Function

.executeScoreFunction()API returns the score for each triple.

Parameters

  •  Triples [[String]]: Variable representing a list of lists of strings, each containing three elements. 

Example

auth_api_client.executeScoreFunction(triples)

9. Admet Prediction

.getAdmetPrediction() returns prediction using ADMET models and sagemaker. 

Parameters

  •  Smiles [String]: Specification in the form of a line notation for describing the structure of chemical species.
  • Model (String): Represents the model name.

Example

auth_api_client.getAdmetPrediction(smiles=smiles, model=model.BBB)

Integrating Orpheus API in Biomedical Research Workflows

The Orpheus API uses a graph embedding model trained on a biomedical knowledge graph to ensure consistency and credibility. Its ability to integrate into existing biomedical research applications allows for bridging knowledge gaps in your applications in no time. Integrating Orpheus API in biomedical research workflows offers the following features:

  • An advanced biomedical knowledge base enables in-depth analysis and accurate predictions.
  • A Foundational Graph embedding model trained on huge biomedical data allows crafting custom AI models for enhanced accuracy and relevance.
  • Semantic AI enables fast and accurate querying for immediate insights.
  • Orpheus API’s cited references increase research credibility.
  • Advanced ADMET models provide key insights into the pharmacokinetics and pharmacodynamics.
  • Easy integration of Orpheus API in any research workflow enhances the functioning of healthcare applications with advanced AI.

Request a unique Orpheus API key today and develop robust Python applications for the novel purpose of innovative healthcare research.

Table of Contents

Scroll to Top