Skip to main content

PPSS - Python Protein Subunit Syntax

A simple Python package for defining protein subunit structures.

Installation

The simplest way to install this is to do as follows:

pip install ppss

You can also install the Poetry packaging and dependency tool and then clone this repository and install with poetry, as follows:

pipx install poetry
git clone https://github.com/sandyjmacdonald/ppss
cd ppss
poetry install

Usage

The simple example below defines a protein comprised of either an S1 plus S1 subunit, or just an S3 subunit. The bar (|) symbol here represents an OR condition or "alternation", while the + represents an AND condition or "concatenation". Subunit IDs can be any combination of upper and/or lowercase alphabetical and numerical characters.

from ppss import ProteinParser

# Instantiate the parser
parser = ProteinParser()

# Define a protein structure
protein_definition = "(S1 + S2) | S3"

# Parse the protein structure
structures = parser.parse(protein_definition)

# Display the structures
for structure in structures:
    print(structure)

The two possible structures are printed:

S1 + S2
S3

The full grammar of the Lark parser is as follows:

?start: protein

protein: alternation

alternation: concatenation ("|" concatenation)*

concatenation: required_term ("+" term)*

?term: required_term
        | optional_term

required_term: multiplicity
                | subunit
                | "(" alternation ")"

optional_term: optional

multiplicity: subunit "{" DIGIT+ "}"
            | "(" alternation ")" "{" DIGIT+ "}"

optional: "[" alternation "]"

subunit: SUBUNIT

SUBUNIT: /[A-Za-z0-9]+/

DIGIT: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

%import common.WS
%ignore WS

Metadata

Release files for ppss 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ppss 0.2.0
File Size Uploaded
ppss-0.2.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ppss 0.2.0
File Interpreter ABI Platform
ppss-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / ppss-0.2.0.tar.gz

Download URL ppss-0.2.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1662922fd7b37c092ea4d4150712bfbf9d6eabf790a6b497ec07453a6ca5f673
BLAKE2b-256 checksum
How to use checksums
fd6364a17abc4cf57e937698ec6f572870b0ffe7e2b1142c25f36ff3b5e5b554
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.5 Darwin/23.0.0

Release files / ppss-0.2.0-py3-none-any.whl

Download URL ppss-0.2.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b903f8f2403d70b4f6085fd2fdffa6ebb6d12c061648e36c3421e424e0aead4
BLAKE2b-256 checksum
How to use checksums
52222bf04f62f4e5598318cf2e56dc19b345b860ec4dd2c0eeda8a23656a79b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.5 Darwin/23.0.0

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page