Python native implementation of selected PhosR style workflows for phosphoproteomics.
Project description
PhosPy
PhosPy is a Python package for phosphoproteomics workflows with a strict public
contract around one dataset boundary and two workflow entrypoints
(KinaseWorkflow, SignalomeWorkflow).
PhosPy does not expose HTTP endpoints or a web service. The supported user interfaces are:
- the Python API
- the
phospycommand-line interface
Install
PhosPy requires Python 3.10 or newer.
For normal package use:
pip install phospy
If you plan to read or write .parquet inputs or outputs, install the optional
parquet extra:
pip install "phospy[parquet]"
For local contributor installs from a clone:
pip install -e ".[dev]"
For editable installs with parquet support:
pip install -e ".[dev,parquet]"
First Run (Supported Happy Path)
Bundled runtime references in this release are rat-only. The recommended first workflow is:
- build an analysis-ready dataset with
organism=Organism.RAT - run kinase with
references=ReferencePreset.AUTO - optionally run signalome on the kinase result
Before you start, make sure your input tables match this minimum shape:
phospho: numeric site-by-sample matrix with site IDs as the row indexsite_metadata: rows aligned tophospho.index, withgene_symbolandsite- site IDs should look like
TSC2;S939; - add
protein_idif you plan to runSignalomeWorkflow
For human or mouse lanes, pass an explicit ReferenceBundle instead of AUTO.
Minimal Python example
import pandas as pd
from phospy import AnalysisReadyDatasetBuilder, KinaseWorkflow, SignalomeWorkflow
from phospy.api import (
DatasetBuildRequest,
KinaseWorkflowRequest,
Organism,
ReferencePreset,
SignalomeWorkflowRequest,
)
phospho = pd.DataFrame(
{
"sample_a": [1.00, 0.70],
"sample_b": [1.10, 0.80],
"sample_c": [0.95, 0.75],
},
index=["TSC2;S939;", "GSK3B;S9;"],
)
site_metadata = pd.DataFrame(
{
"gene_symbol": ["TSC2", "GSK3B"],
"site": ["S939", "S9"],
"site_sequence": [
"FDDTPEKDSFRARSTSLNERPKSLRIARAPK",
"_______MSGRPRTTSFAESCKPVQQPSAFG",
],
"protein_id": ["TSC2", "GSK3B"],
},
index=phospho.index.copy(),
)
dataset = AnalysisReadyDatasetBuilder().run(
DatasetBuildRequest(
phospho=phospho,
site_metadata=site_metadata,
organism=Organism.RAT,
)
)
kinase_result = KinaseWorkflow().run(
KinaseWorkflowRequest(
dataset=dataset,
references=ReferencePreset.AUTO,
)
)
pred_mat = kinase_result.prediction_result.pred_mat
# Optional signalome step (requires site_metadata.protein_id)
signalome_result = SignalomeWorkflow().run(
SignalomeWorkflowRequest(kinase_result=kinase_result)
)
If you copy the example as-is, you should end up with:
- a strict
AnalysisReadyPhosphoDataset dataset.phospho.shape == (2, 3)- a non-empty kinase prediction matrix in
pred_mat - a signalome result only when
protein_idis present for every interpreted site
Minimal CLI example
phospy kinase \
--phospho ./input/phospho.csv \
--site-metadata ./input/site_metadata.csv \
--organism rat \
--reference auto \
--outdir ./out
That command writes a dataset directory, a kinase directory, and a short summary of written file paths.
Import Contract
phospy.api is the canonical namespace where public API types are defined and organised in source.
Both namespaces are public, with different roles:
- top-level
phospyis a curated convenience surface for only:AnalysisReadyDatasetBuilder,AnalysisReadyPhosphoDataset,KinaseWorkflow,SignalomeWorkflow - requests, configs, results, enums or references, and errors are imported from
phospy.api
CLI vs Python API
The phospy CLI is intentionally narrow and file-first. It supports the public
happy-path flow (dataset-build, kinase, signalome) with selected
high-value runtime knobs.
Use the CLI for reproducible command-line execution from files. Use the Python
API (phospy.api) when you need the full request and config surface, including
DatasetPreprocessingConfig, explicit ReferenceBundle injection, DataFrame
inputs, or advanced scoring and signalome configuration.
Citation
If you use PhosPy in scientific work, cite this software release using
CITATION.cff and also cite the upstream PhosR project and
publications described in NOTICE.md.
Where To Go Next
- Guided onboarding: Quickstart: first workflow
- First failure recovery: Troubleshooting: first-run and supported-lane failures
- CLI scope and command usage: CLI Guide
- Full contract details: API Guide, Validation Guide
- Release framing for the shipped 1.5.0 contract: Release Notes 1.5.0
- Runnable demos after you understand the first-run flow:
python examples/dataset_builder_demo.pypython examples/kinase_workflow_demo.pypython examples/signalome_workflow_demo.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phospy-1.5.0.tar.gz.
File metadata
- Download URL: phospy-1.5.0.tar.gz
- Upload date:
- Size: 316.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7874def14c46a39f9fda39bf37f1b2854ef43213db2b2e66565afcdb2a94464
|
|
| MD5 |
e2f515997d547fc2c542c69b7eb20858
|
|
| BLAKE2b-256 |
93fe4d9f44dec1d650c4f8a723f77769ea557addaa11d71691bec9427157acf8
|
Provenance
The following attestation bundles were made for phospy-1.5.0.tar.gz:
Publisher:
publish.yml on falconsmilie/phospy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phospy-1.5.0.tar.gz -
Subject digest:
f7874def14c46a39f9fda39bf37f1b2854ef43213db2b2e66565afcdb2a94464 - Sigstore transparency entry: 1362310213
- Sigstore integration time:
-
Permalink:
falconsmilie/phospy@90c98964b0cdd830655a2858fa79b0827dbfddfb -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/falconsmilie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@90c98964b0cdd830655a2858fa79b0827dbfddfb -
Trigger Event:
push
-
Statement type:
File details
Details for the file phospy-1.5.0-py3-none-any.whl.
File metadata
- Download URL: phospy-1.5.0-py3-none-any.whl
- Upload date:
- Size: 373.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
909bbb4035bb4d5be6887c5e6d495b80a7e796dc2e15f519e1e2a8584fea3a8f
|
|
| MD5 |
fa539f89732760eb54a2e0162ae1f168
|
|
| BLAKE2b-256 |
0789ec5f1617348f41c07099759b30d73e233a070439e6d75941f548e7121f86
|
Provenance
The following attestation bundles were made for phospy-1.5.0-py3-none-any.whl:
Publisher:
publish.yml on falconsmilie/phospy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phospy-1.5.0-py3-none-any.whl -
Subject digest:
909bbb4035bb4d5be6887c5e6d495b80a7e796dc2e15f519e1e2a8584fea3a8f - Sigstore transparency entry: 1362310285
- Sigstore integration time:
-
Permalink:
falconsmilie/phospy@90c98964b0cdd830655a2858fa79b0827dbfddfb -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/falconsmilie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@90c98964b0cdd830655a2858fa79b0827dbfddfb -
Trigger Event:
push
-
Statement type: