Skip to main content

Client library for the Motif Studio API

Project description

MotifStudio: Python SDK

MotifStudio is a platform for analyzing subnetwork motifs in connectome graphs. This Python SDK allows users to interact with the MotifStudio API to perform various operations such as querying graphs, retrieving motifs, and more.

Installation

In order to use the MotifStudio Python SDK, you need to install the motifstudio package. You can do this using pip or uv:

# SLOW:
# pip install motifstudio-client

# Add motifstudio-client to a project FAST:
uv add motifstudio-client

Usage

To use the MotifStudio Python SDK, you need to create an instance of the MotifStudioClient class and provide the API endpoint. You can then use this instance to interact with the API. (The SDK defaults to the public API endpoint but if you are using a private instance, you can specify the URL.)

from motifstudio_client import MotifStudioClient
m = MotifStudioClient("https://api.motifstudio.bossdb.org")

To get a list of available "host" graphs, you can use the hosts object, which behaves like a dictionary:

g.hosts.keys()  # List all available host graphs

You can perform basic operations such as querying the number of vertices or edges in the graph:

m.query("Takemura2013_Medulla").vertices_count()
m.query("Takemura2013_Medulla").edges_count()

Perform a motif search on a specific graph:

my_triangle_motif = """
A->B
B->C
C->A
"""

m.query("Takemura2013_Medulla").motifs(my_triangle_motif)  # Example motif query

You can also download a graph into a local NetworkX object for local analysis:

g = m.hosts.get_graph("Takemura2013_Medulla")

Made with 💙 at JHU APL

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

motifstudio_client-0.1.1.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

motifstudio_client-0.1.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file motifstudio_client-0.1.1.tar.gz.

File metadata

  • Download URL: motifstudio_client-0.1.1.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for motifstudio_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 353ea0206516a935e2000bbe7605431f909a41336fe6418c380c971b81c5296d
MD5 b5c71d065ca30f8257c36dd137798b8a
BLAKE2b-256 712044327c28f21d4a8b9e737ea80f6f9a7c38bb9d3a59fc1b6a32d4acc36dc4

See more details on using hashes here.

File details

Details for the file motifstudio_client-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for motifstudio_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4718050e4c18530019e953ba302bcbce8239dc556a7670ab6783347f2ac6078
MD5 846fcc46a287b5e0243595dd4e90a786
BLAKE2b-256 d7be0ce485f8f7e87c0bca6d1f8efaa8996d1d76f43d15d8218fcb532f2a2da5

See more details on using hashes here.

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