Python native implementation of selected PhosR style workflows for phosphoproteomics.
Project description
PhosPy
PhosPy is a Python package for selected phosphoproteomics workflows inspired by PhosR. It is aimed at scientists who want a clear Python lane from phosphosite intensity tables to kinase scoring, kinase prediction, and optional signalome analysis.
PhosPy does not provide 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.
pip install phospy
For .parquet input or output support:
pip install "phospy[parquet]"
For local development from a clone:
pip install -e ".[dev]"
pyright
pytest -m "not parity"
For reproducible scientific/regression runs aligned to CI:
pip install -c constraints/ci.txt -e ".[dev,test]"
pytest tests/parity -m parity -s
Beginner Lane
The smallest supported lane is:
- build a dataset with
organism=Organism.RAT - run kinase with
references=ReferencePreset.AUTO - run signalome only when
site_metadata.protein_idis present
Bundled runtime references in 1.5.0 are rat-only. For human or mouse work,
create and pass an explicit ReferenceBundle in Python instead of using
ReferencePreset.AUTO.
Minimum Input Shape
phospho is a numeric site-by-sample table. Its index should use standard
PhosPy site IDs such as TSC2;S939;.
site_metadata must align to phospho.index and include:
gene_symbolsitesite_sequencewhen you want motif-based scoringprotein_idwhen you want signalome analysis
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,
activity_config=None, # keep this tiny two-site example in the safe lane
)
)
signalome_result = SignalomeWorkflow().run(
SignalomeWorkflowRequest(kinase_result=kinase_result)
)
print(dataset.phospho.shape)
print(kinase_result.prediction_result.pred_mat.round(4))
print(signalome_result.signalome_modules.table)
With the tables above you should get a strict AnalysisReadyPhosphoDataset, a
non-empty kinase prediction matrix, and signalome tables because every site has
an explicit protein_id.
Minimal CLI Example
phospy kinase \
--phospho ./input/phospho.csv \
--site-metadata ./input/site_metadata.csv \
--organism rat \
--reference auto \
--skip-activity \
--outdir ./out
The CLI writes a dataset directory, a kinase directory, and a short list of file paths written.
Import Contract
Use top-level phospy for the four main entrypoints only:
from phospy import AnalysisReadyDatasetBuilder, AnalysisReadyPhosphoDataset
from phospy import KinaseWorkflow, SignalomeWorkflow
Use phospy.api for requests, configs, results, enums, references, and public
exceptions.
Documentation
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.
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.1.tar.gz.
File metadata
- Download URL: phospy-1.5.1.tar.gz
- Upload date:
- Size: 405.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2027ec8957798591a650c17d7eba1c8467a39010143f619e4d3bdace0c3dc14
|
|
| MD5 |
83ef7ab5758dde0e8b138d3c19144b15
|
|
| BLAKE2b-256 |
a2f44179eeae278b9c60f7a86c3b1efce13311fb318aabad7cc4c48a3f4e57d2
|
Provenance
The following attestation bundles were made for phospy-1.5.1.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.1.tar.gz -
Subject digest:
d2027ec8957798591a650c17d7eba1c8467a39010143f619e4d3bdace0c3dc14 - Sigstore transparency entry: 1401864876
- Sigstore integration time:
-
Permalink:
falconsmilie/phospy@b4965db4fca45980d8b8cbcd6f80b36990a58798 -
Branch / Tag:
refs/tags/v1.5.1 - Owner: https://github.com/falconsmilie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b4965db4fca45980d8b8cbcd6f80b36990a58798 -
Trigger Event:
push
-
Statement type:
File details
Details for the file phospy-1.5.1-py3-none-any.whl.
File metadata
- Download URL: phospy-1.5.1-py3-none-any.whl
- Upload date:
- Size: 491.7 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 |
0cd1f6b295e877c2cd7744cac03a27de7b4df15a71a7b7307323d7f0a1ef1091
|
|
| MD5 |
4b537d954147c035fc1fcc0999b2b407
|
|
| BLAKE2b-256 |
38446be4a6d66f2a37549054af04780290ad43fbce0ac5a3cb72dd174b4cf718
|
Provenance
The following attestation bundles were made for phospy-1.5.1-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.1-py3-none-any.whl -
Subject digest:
0cd1f6b295e877c2cd7744cac03a27de7b4df15a71a7b7307323d7f0a1ef1091 - Sigstore transparency entry: 1401864998
- Sigstore integration time:
-
Permalink:
falconsmilie/phospy@b4965db4fca45980d8b8cbcd6f80b36990a58798 -
Branch / Tag:
refs/tags/v1.5.1 - Owner: https://github.com/falconsmilie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b4965db4fca45980d8b8cbcd6f80b36990a58798 -
Trigger Event:
push
-
Statement type: