Metadata-Version: 2.4
Name: alphapulldown-input-parser
Version: 0.5.0
Summary: Fold specification parser for AlphaPulldown
Author-email: Kosinski Lab <alphapulldown@embl-hamburg.de>
License: MIT
Project-URL: Homepage, https://github.com/KosinskiLab/alphapulldown-input-parser
Project-URL: Issues, https://github.com/KosinskiLab/alphapulldown-input-parser/issues
Keywords: alphapulldown,folding,bioinformatics,parser
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# alphapulldown-input-parser

Reusable parser for AlphaPulldown-style fold specifications. Install it with:

```bash
pip install "alphapulldown-input-parser>=0.4.0"
```

or, for local development:

```bash
pip install -e /path/to/alphapulldown-input-parser
```

The package exposes three helpers:

* `parse_fold(...)` – mirrors the historical AlphaPulldown helper and performs
  feature existence checks.
* `expand_fold_specification(...)` – expands a single fold string without
  raising if features are missing.
* `parse_fold_chains(spec, protein_delimiter="+")` – **pure-syntactic** parse
  of a single spec into `(chain_name, copies, regions)` triples, with no
  filesystem access or feature lookup. Useful for resource sizing or input
  validation before features exist on disk.

The parser is dependency-free and works across AlphaPulldown, the Snakemake
pipeline, or any other tooling that consumes the same fold syntax.

As of `0.4.0`, AF3 JSON feature files support the same copy/range suffixes as
classic AlphaPulldown feature pickles, including discontinuous regions and copy
counts. For example:

```python
parse_fold(
    [
        "P01258_af3_input.json:1-100",
        "P01258_af3_input.json:1-100:150-200",
        "P01258_af3_input.json:2:1-100:150-200+P01579_af3_input.json",
    ],
    features_directory=["/path/to/features"],
    protein_delimiter="+",
)
```

AlphaPulldown and AlphaPulldownSnakemake can then preserve those AF3 JSON
regions during input preparation. For the AlphaFold 3 backend, discontinuous
regions are expanded into separate cropped chains rather than one continuous
polymer chain.
