GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - cdawson-nurix/md-python

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

97 Commits
97 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
development/GI
development/GI
 
 
examples
examples
 
 
src/md_python
src/md_python
 
 
tests
tests
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
LICENSE
LICENSE
 
 
Notebook Quickstart.md
Notebook Quickstart.md
 
 
README.md
README.md
 
 
V1.md
V1.md
 
 
environment.yaml
environment.yaml
 
 
pyproject.toml
pyproject.toml
 
 
setup.py
setup.py
 
 

Repository files navigation

LICENSE

MD Python Client

A Python client for the Mass Dynamics API.

Installation

pip install https://github.com/MassDynamics/md-python/archive/refs/tags/v0.2.2-26.tar.gz

Quick Start

from md_python import MDClient

client = MDClient(api_token="your_api_token")

The client defaults to the v2 API. For v1 usage, see V1.md.

Resources

  • Uploads: Create, retrieve, and manage file uploads
  • Datasets: Create, list, retry, cancel, and delete datasets
  • Jobs: List available dataset jobs
  • Health: Check API health status

Uploads

Uploads replace v1 experiments. They handle file ingestion and workflow triggering.

from md_python import Upload, ExperimentDesign, SampleMetadata

experiment_design = ExperimentDesign(data=[
    ["filename", "sample_name", "condition"],
    ["evidence.txt", "sample1", "control"],
    ["proteinGroups.txt", "sample2", "treated"],
])

sample_metadata = SampleMetadata(data=[
    ["sample_name", "condition"],
    ["sample1", "control"],
    ["sample2", "treated"],
])

# Create an upload from S3
upload = Upload(
    name="My Upload",
    source="maxquant",
    s3_bucket="my-bucket",
    s3_prefix="data/",
    filenames=["evidence.txt", "proteinGroups.txt"],
    experiment_design=experiment_design,
    sample_metadata=sample_metadata,
)
upload_id = client.uploads.create(upload)

# Create an upload from local files
upload = Upload(
    name="My Upload",
    source="maxquant",
    file_location="/path/to/files",
    filenames=["evidence.txt", "proteinGroups.txt"],
    experiment_design=experiment_design,
    sample_metadata=sample_metadata,
)
upload_id = client.uploads.create(upload)

# Get upload by ID or name
upload = client.uploads.get_by_id(upload_id)
upload = client.uploads.get_by_name("My Upload")

# Update sample metadata
sample_metadata = SampleMetadata(data=[
    ["sample_name", "condition"],
    ["sample1", "control"],
    ["sample2", "treated"],
])
client.uploads.update_sample_metadata(upload_id, sample_metadata)

# Wait for upload processing to complete
upload = client.uploads.wait_until_complete(upload_id)

Datasets

from uuid import UUID
from md_python import Dataset

# Create a dataset
dataset = Dataset(
    input_dataset_ids=[UUID("existing-dataset-id")],
    name="Processed Data",
    job_slug="pairwise_comparison",
    job_run_params={"condition_column": "condition"},
)
dataset_id = client.datasets.create(dataset)

# List datasets for an upload
datasets = client.datasets.list_by_upload(upload_id)

# Find the initial intensity dataset
initial = client.datasets.find_initial_dataset(upload_id)

# Retry a failed dataset
client.datasets.retry(dataset_id)

# Cancel a processing dataset
client.datasets.cancel(dataset_id)

# Delete a dataset
client.datasets.delete(dataset_id)

# Wait for a dataset to complete
ds = client.datasets.wait_until_complete(upload_id, dataset_id)

Jobs

# List available dataset jobs
jobs = client.jobs.list()

Health

health_status = client.health.check()

Custom Base URL

client = MDClient(
    api_token="your_api_token",
    base_url="https://xxx.massdynamics-example-installation.com/api",
)

V1 API

For v1 API usage, pass version="v1" or see V1.md.

client = MDClient(api_token="your_api_token", version="v1")

Development

git clone https://github.com/MassDynamics/md-python.git
cd md-python
pip install -e ".[dev]"
pytest

About

No description, website, or topics provided.

Resources

Readme
License
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.