Metadata-Version: 2.4
Name: lika-network
Version: 0.1.0
Summary: Likelihood Inference of Kinase Activity from substrate p-values or raw phosphoproteomic intensities.
Author: Lujing Zhang
License-Expression: MIT
Project-URL: Paper, https://doi.org/10.64898/2026.08.06.743374
Project-URL: Preprint, https://www.biorxiv.org/content/10.64898/2026.08.06.743374v1
Keywords: kinase,phosphoproteomics,network,LIKA
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Requires-Dist: bottleneck>=1.4.2
Requires-Dist: networkx>=3.2
Requires-Dist: numexpr>=2.10.2
Requires-Dist: numpy>=1.26
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: pandas>=2.1
Requires-Dist: scipy>=1.11
Requires-Dist: statsmodels>=0.14
Requires-Dist: torch>=2.2
Requires-Dist: tqdm>=4.66
Dynamic: license-file

# LIKA

LIKA, Likelihood Inference of Kinase Activity, ranks kinases from substrate-level
p-values while accounting for many-to-many kinase-substrate network annotations.

This repository is now structured as a Python package. It includes a default
KSEA-derived kinase-substrate network as package data, but users can provide
their own network as CSV or GraphML. See [Third-Party Data](#third-party-data)
for citation and upstream data-use notes.

## Installation

```bash
python -m pip install lika-network
```

From source:

```bash
python -m pip install .
```

For development:

```bash
python -m pip install -e .
```

## Run LIKA From Substrate P-Values

The substrate file may be CSV or Excel. It must contain substrate names and
p-values. Common column names are detected automatically, including `Name`,
`substrate`, `substrate_name`, `phosphosite`, `phosphosite_name`, `p_value`,
`p-value`, `p.value`, and `pvalue`.

```bash
lika run --substrates substrate_p_values.csv --output lika_results.csv
```

For Excel files, LIKA auto-detects the first sheet with substrate and p-value
columns. You can also select one explicitly:

```bash
lika run --substrates phospho_data.xlsx --sheet lika_data --output lika_results.csv
```

Use a custom network:

```bash
lika run \
  --substrates substrate_p_values.csv \
  --network kinase_substrate_network.graphml \
  --output lika_results.csv
```

CSV networks use `from` and `to` columns, with an optional `weight` column.
GraphML networks must be directed kinase-to-substrate graphs. If no network is
provided, LIKA uses the packaged `KSEA_dataset_processed.csv` network.

The output includes:

- `Name`: kinase name. Indistinguishable kinases may be merged with `_`.
- `LIKA_p_value`: kinase-level LIKA p-value.
- `LIKA_rank`: LIKA ranking.
- `LIKA_influence_score`: weighted effective number of observed substrates.

Optional score columns:

- `--mle` adds `LIKA_mle`, the maximum-likelihood estimate of kinase dysregulation probability.
- `--lower-bound` adds `LIKA_score`, a lower confidence bound for the kinase dysregulation probability.

By default, `--lower-bound` uses the profile-likelihood lower bound from an 80%
confidence interval (`--score-alpha 0.2`). Use `--score-method mle` for faster
exploratory runs that report the raw MLE as the score.

## Process Raw Control/Case Intensities

Raw data should contain a substrate name column, a group column, and replicate
measurement columns. By default, LIKA uses columns whose names contain
`intensity`. Use `--intensity-column` to select a different column name or name
fragment, such as `abundance` or `area`. Zero intensities are treated as
missing.

```bash
lika process \
  --input raw_intensities.csv \
  --group-column Group \
  --control-label 0 \
  --case-label 1 \
  --output substrate_p_values.csv
```

Use a different measurement column name or fragment:

```bash
lika process \
  --input raw_abundance.csv \
  --group-column Group \
  --intensity-column abundance \
  --output substrate_p_values.csv
```

Separate control and case files are also supported:

```bash
lika process \
  --control control.csv \
  --case case.csv \
  --output substrate_p_values.csv
```

Then run LIKA on the generated substrate p-values:

```bash
lika run --substrates substrate_p_values.csv --output lika_results.csv
```

## Query Kinases

Print results for specific kinases:

```bash
lika query --results lika_results.csv --kinases ABL1 EGFR
```

Write queried rows to a CSV with `--output`:

```bash
lika query --results lika_results.csv --kinases ABL1 EGFR --output kinase_query.csv
```

You can also query during a run:

```bash
lika run --substrates substrate_p_values.csv --kinases ABL1 EGFR --output kinase_query.csv
```

## Override Edge Weights

By default, all edges have weight `1.0`. Provide a weight override CSV with
`from`, `to`, and `weight` columns:

```bash
lika run \
  --substrates substrate_p_values.csv \
  --weights edge_weights.csv \
  --output lika_weighted_results.csv
```

Weights must be positive finite numbers. Weighted runs use normalized upstream
weights in the LIKA likelihood and weighted influence score.

## Export GraphML Kinase Neighborhoods

Export the target kinase, its observed substrate neighbors, and kinases sharing
those substrates:

```bash
lika run \
  --substrates substrate_p_values.csv \
  --kinases ABL1 EGFR \
  --visualize-dir kinase_graphml \
  --output lika_results.csv
```

Or export without fitting LIKA:

```bash
lika visualize \
  --substrates substrate_p_values.csv \
  --kinase ABL1 \
  --output ABL1.graphml
```

## Python API

```python
import lika

result = lika.run_lika("substrate_p_values.csv", output="lika_results.csv")
print(result.results.head())

substrates = lika.process_raw_data(
    "raw_intensities.csv",
    group_column="Group",
    intensity_columns="intensity",
    control_label=0,
    case_label=1,
    output="substrate_p_values.csv",
)

query = lika.query_kinases(result.results, ["ABL1", "EGFR"])
lika.export_kinase_visualizations(result.network, ["ABL1"], "kinase_graphml")
```

## Citation

LIKA is the software implementation of the method described in:

Zhang L, Demarco AG, Ghafari K, Devlin B, MacDonald ML, Roeder K. Inferring
disruption of directed graphs using LIKA reveals altered protein phosphorylation
networks in schizophrenia. bioRxiv. 2026. doi:10.64898/2026.08.06.743374.
Version 1 posted August 7, 2026:
https://www.biorxiv.org/content/10.64898/2026.08.06.743374v1.

If you use the bundled default KSEA-derived kinase-substrate network, also cite
the upstream KSEA App:

Wiredja DD, Koyuturk M, Chance MR. The KSEA App: a web-based tool for kinase
activity inference from quantitative phosphoproteomics. Bioinformatics.
2017;33(21):3489-3491. doi:10.1093/bioinformatics/btx415.

Additional upstream network provenance is listed in `THIRD_PARTY_NOTICES.md`.

## Third-Party Data

The bundled default network in `src/lika/data/KSEA_dataset_processed.csv` was
derived from kinase-substrate annotations made available through the KSEA App:
https://casecpb.shinyapps.io/ksea/.

The LIKA package code is released under the MIT License. The bundled
KSEA-derived network is third-party source material and may be subject to
upstream KSEA App, PhosphoSitePlus, and NetworKIN terms. The KSEA App site
states that the app is for non-commercial use and that use of PhosphoSitePlus
data is subject to PhosphoSitePlus terms and conditions.

## License

The LIKA package code is released under the MIT License. See `LICENSE`.
