Skip to content

Usage

Installation

git clone https://github.com/bibymaths/phospho-velocity
cd phospho-velocity
pip install -e ".[dev]"

Command-Line Interface

Parse MaxQuant data

phospho-velocity parse \
  --input "Phospho (STY)Sites.txt" \
  --output results/long_data.csv

Preprocess

phospho-velocity preprocess \
  --input results/long_data.csv \
  --output results/processed.csv \
  --missingness interpolate

Fit GP models and compute velocities

phospho-velocity fit \
  --input results/processed.csv \
  --output results/velocity.csv

Full pipeline

phospho-velocity run \
  --input "Phospho (STY)Sites.txt" \
  --output-dir results/ \
  --missingness keep

Python API

from phospho_velocity.config import PipelineConfig, ModelConfig
from phospho_velocity.pipeline import run_pipeline

config = PipelineConfig(
    input_file="Phospho (STY)Sites.txt",
    output_dir="results/",
    model=ModelConfig(),
)
results = run_pipeline(config)

print(results["velocity"].head())

Custom Time Map

from phospho_velocity.preprocessing.normalize import assign_time

custom_map = {
    ("MY_CELL_LINE", 1): 0.0,
    ("MY_CELL_LINE", 2): 30.0,
    ("MY_CELL_LINE", 3): 120.0,
}
df = assign_time(df, custom_map)

Bayesian Mode

from phospho_velocity.velocity.compute import run_bayesian_velocity

vel_df = run_bayesian_velocity(df, n_samples=500, n_tune=500)
print(vel_df[["site_id", "time_min", "velocity_mean", "velocity_sd"]].head())