Metadata-Version: 2.4
Name: peplocus
Version: 0.7.0
Summary: Fast peptide-to-genome mapping with splice-junction support and optional one-edit/adjacent-swap rescue
Author: Qussai Abbas
License-Expression: MIT
Project-URL: Homepage, https://github.com/qussai96/PepLocus
Project-URL: Source, https://github.com/qussai96/PepLocus
Project-URL: Issues, https://github.com/qussai96/PepLocus/issues
Keywords: proteogenomics,peptides,genome,splicing,BED12
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.23
Requires-Dist: biopython>=1.80
Requires-Dist: pyahocorasick>=2.0
Requires-Dist: pysam>=0.22
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Dynamic: license-file

# PepLocus

Map mass-spectrometry peptides directly to genome assemblies, including splice-junction peptides. I/L are always treated as equivalent.

![PepLocus overview](https://raw.githubusercontent.com/qussai96/PepLocus/main/PepLocus.png)

## Install

Requires Python 3.9 or newer.

```bash
pip install peplocus
```

## Run

```bash
peplocus -a assembly.fa -p peptides.tsv --out results
```

Add a GTF/GFF annotation, an RNA-seq BAM, or both for splice-aware mapping:

```bash
peplocus -a assembly.fa -p peptides.tsv -g models.gtf -b rnaseq.bam --out results
```

Peptides can be a plain list, FASTA, CSV or TSV, including FragPipe output. The default is **8 workers**; change it with `--threads`.

Optional searches:

- `--one-edit`: rescue exact-unmapped peptides with one substitution, insertion or deletion.
- `--swap`: rescue exact-unmapped peptides with one adjacent amino-acid swap.
- `--discover-junctions`: search for canonical splice junctions using the selected workers; default minimum **11 aa**, maximum intron **10 kb**. Short queries can still produce chance matches.

`--one-edit` and `--swap` work separately or together. Both use a **9-aa minimum** by default (`--min-rescue-length`).

Use `--enzyme trypsin/p` to allow K/R cleavage before proline (for matching FragPipe digestion settings), or `--enzyme none` for unrestricted peptides such as Casanovo predictions. The default `trypsin` excludes cleavage before proline. Enzyme choice changes the compatible subset, not the all-mappings track.

## Outputs

- `all_mappings.bed` and `tryptic_mappings.bed`: all exact placements and their tryptic-compatible subset, in BED12 format.
- `mappings.tsv`: placement details; `peptides.tsv`: per-peptide counts and status.
- `unmapped.tsv`: peptides without an exact match; `summary.json`: counts and timings.
- `rescue/`: separate approximate candidates when rescue is enabled.

Rescue candidates are sequence-compatible possibilities, not confirmed variants. Splice mapping depends on the available evidence and search limits.

Ambiguity counts refer to overlapping genomic regions; all distinct block-chain placements remain available. Unsupported trans-spliced annotation transcripts are skipped with a warning. See [mapping conventions](docs/mapping_conventions.md).

For more options, run `peplocus -h`.

Tests: `pip install ".[test]"`, then `python -m pytest -q tests` from a repository checkout.

[Report an issue](https://github.com/qussai96/PepLocus/issues) · [MIT license](LICENSE)
