Python native implementation of selected PhosR style workflows for phosphoproteomics.
Project description
PhosPy
PhosPy is a Python package for a small, supported set of phosphoproteomics workflows inspired by PhosR.
It is built for three main jobs:
- Preprocessing raw total and phospho tables with
PhosphoDataset - Kinase scoring and prediction with
SimpleKinaseWorkflow - Signalome analysis with
SignalomeWorkflow
PhosPy is intentionally narrow. It is not a full PhosR replacement.
Install
PhosPy supports Python 3.10 and newer.
pip install phospy
Optional parquet support:
pip install "phospy[parquet]"
Start Here
Use PhosphoDataset when you want preprocessing only
from phospy.datasets import PhosphoDataset
from phospy.preprocessing import CorePreprocessingConfig
dataset = PhosphoDataset.from_files(
"examples/data/total.tsv",
"examples/data/phospho.tsv",
phospho_encoding="utf-16le",
)
analysis_ready = dataset.preprocessing.run_analysis_ready(
config=CorePreprocessingConfig(max_unmatched_fraction=0.1)
)
You get a validated, analysis-ready dataset that you can pass into downstream workflows.
Use SimpleKinaseWorkflow for the common end-to-end path
from phospy.api import PredictionRunConfig, SimpleKinaseWorkflow
with SimpleKinaseWorkflow().run(
phospho="examples/data/simple_workflow/phospho.tsv",
total="examples/data/simple_workflow/total.tsv",
species="rat",
prediction_config=PredictionRunConfig(
min_substrates=1,
min_motif_size=1,
ensemble_size=2,
top=3,
inclusion=2,
n_iterations=2,
random_state=7,
),
) as result:
pred_mat = result.pred_mat_result.to_frame(copy=False)
weighted_activity = result.kinase_activity_result.weighted_activity
This path handles preprocessing, analysis-ready adaptation, bundled reference selection, prediction, and kinase activity analysis.
Use SignalomeWorkflow when you already have workflow outputs
The next example assumes you already have a result from SimpleKinaseWorkflow.run(...).
from phospy.api import SignalomeRunConfig, SignalomeWorkflow
signalome = SignalomeWorkflow().run_from_analysis_ready(
dataset=result.analysis_ready_dataset,
scoring_result=result.scoring_result,
prediction_result=result.prediction_result,
kinases_of_interest=list(result.pred_mat_result.kinase_names[:2]),
config=SignalomeRunConfig(signalome_cutoff=0.5),
)
Minimum Input Expectations
PhosPy works with:
- total input as TSV
- phospho input as TSV
predMatas CSV, with the first column used as the phosphosite index
Default required columns:
| Input | Required columns |
|---|---|
| Total table | genes, group1 to group6 |
| Phospho table | uid, gene_names, gene_p_site, localization_prob, centralized_sequence, p_group1 to p_group6 |
For full validation rules and common failure cases, see docs/validation.md.
CLI
PhosPy ships with a small CLI for file-based preprocessing and optional kinase activity analysis from an existing predMat.
phospy \
--total examples/data/total.tsv \
--phospho examples/data/phospho.tsv \
--pred-mat examples/data/predMat.csv \
--phospho-encoding utf-16le \
--max-unmatched-fraction 0.1 \
--outdir examples/output
Use phospy --help to see every option.
Runnable Examples
examples/simple_workflow_demo.pyexamples/signalome_workflow_demo.pyexamples/signalome_map_demo.pyexamples/kinase_activity_analyzer_demo.py
Read Next
Beginner guides
docs/api.mdfor the supported Python APIdocs/validation.mdfor input rules and common failures
Advanced and contributor docs
docs/parity.mdfor parity scope andsvm_modedocs/fixtures.mdfor fixture and trace rebuild commandsdocs/architecture/package-layout.mdfor package ownership and contributor layout rulesdocs/roadmap.mdfor likely next areas of work
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.4.0.tar.gz.
File metadata
- Download URL: phospy-1.4.0.tar.gz
- Upload date:
- Size: 225.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b2e446a82813b6c2cb8691d71b0769d6e7577b8438a9a0f6f87446bf536a960
|
|
| MD5 |
0aa88778d12fae61d84349f8ad128ffb
|
|
| BLAKE2b-256 |
c3a4ad64e5e699a2a62384957bfe70cce228433075dc723f5ef08063a7d08d20
|
Provenance
The following attestation bundles were made for phospy-1.4.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.4.0.tar.gz -
Subject digest:
2b2e446a82813b6c2cb8691d71b0769d6e7577b8438a9a0f6f87446bf536a960 - Sigstore transparency entry: 1306703084
- Sigstore integration time:
-
Permalink:
falconsmilie/phospy@8a8f80876c4cf15312cb20bbcbc51d3d6db3654c -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/falconsmilie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8a8f80876c4cf15312cb20bbcbc51d3d6db3654c -
Trigger Event:
push
-
Statement type:
File details
Details for the file phospy-1.4.0-py3-none-any.whl.
File metadata
- Download URL: phospy-1.4.0-py3-none-any.whl
- Upload date:
- Size: 193.3 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 |
8fab55f05e4c5a8a3ec16401f3721115fc6000e363a000956213e7883ed9f3fb
|
|
| MD5 |
e532befcfc1ef88954aeedd98cbf77ed
|
|
| BLAKE2b-256 |
12a3b73e7c2d13278690ac0cdd6396d57a0c64c11d7a87bad0ef4541baf4a25c
|
Provenance
The following attestation bundles were made for phospy-1.4.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.4.0-py3-none-any.whl -
Subject digest:
8fab55f05e4c5a8a3ec16401f3721115fc6000e363a000956213e7883ed9f3fb - Sigstore transparency entry: 1306703163
- Sigstore integration time:
-
Permalink:
falconsmilie/phospy@8a8f80876c4cf15312cb20bbcbc51d3d6db3654c -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/falconsmilie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8a8f80876c4cf15312cb20bbcbc51d3d6db3654c -
Trigger Event:
push
-
Statement type: