Skip to main content

Pathogen Decision Engine Package

The Decision Engine Package is a Python package for building and using decision engines based on rule sets defined in CSV files. Its main purpose is to implement the decision mechanism described in the SOVAD [^1] paper to classify the pathogenicity of a mutation given a well-known set of predictors.

Twin project using GoRules' zen-engine : sovad-gorules

Installation

You can install the package via pip:

pip install pathogen-decision-engine

or building the module locally

pip install -e .

Usage

Command-Line Interface (CLI)

The package provides a command-line interface (CLI) for performing inference using the decision engine.

To use the CLI, you can provide either the path of a rule table path made as a CSV file. The engine expect a rule table file made of a table of shape N x M+1 where N is the number of rules, M is the number of predictors and +1 is referring to the classification label for each rule. Each cell can be empty or filled with a symbol (>, >=, ==, <, <=) and a value, indicating a numeric constraint for a certain predictor regarding a certain rule. Example:

decision_engine_cli --rule_table_path data/sovad_rules_table.csv --input_sample '{"PA":1, "PVS":0, "PS":1, "PM":2, "PP":1, "BA":1, "BS":0, "BP":0}'

You can pass a rule table in the form of dict expressed as a string Example:

decision_engine_cli --rule_table_dict "{'PA':{'0':1,'1':0},'PVS':{'0':0,'1':1},'PS':{'0':0,'1':'>=1'},'PM':{'0':0,'1':0},'PP':{'0':0,'1':0},'BA':{'0':0,'1':0},'BS':{'0':0,'1':0},'BP':{'0':0,'1':0},'Output':{'0':'Pathogenic','1':'Pathogenic','2':'Pathogenic'}}" --input_dict '{"PA":1, "PVS":0, "PS":1, "PM":2, "PP":1, "BA":1, "BS":0, "BP":0}'

Python API

You can also use the package programmatically in your Python code. Here's an example of how to use the DecisionEngine class:

from pathogen_decision_engine import PathogenDecisionEngine

df = None ### ... create a df dataframe as you wish

# Create a DecisionEngine object
decision_engine = PathogenDecisionEngine(df)

# Define input dictionary
input_sample = {"PA":1, "PVS":0, "PS":1, "PM":2, "PP":1, "BA":1, "BS":0, "BP":0}
# Or you can define your input as list of sovad predictors, then the engine will take care of the counting:
input_sample = ["PA2", "PS1", "PP4", "PM3" ] # in this case you can omit the predictors with 0 count

# Perform inference
result = decision_engine.infer(input_sample)
print(result)

References

[^1] [Koeppel, Florence et al.] “Standardisation of pathogenicity classification for somatic alterations in solid tumours and haematologic malignancies.” [European journal of cancer (Oxford, England : 1990) vol. 159 (2021): 1-15].

Metadata

Release files for pathogen-decision-engine 1.3.1

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

Source distribution (sdist)

Source distribution for pathogen-decision-engine 1.3.1
File Size Uploaded Provenance Actions
pathogen_decision_engine-1.3.1.tar.gz 5.4 kB Without provenance Details for pathogen_decision_engine-1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pathogen-decision-engine 1.3.1
File Interpreter ABI Platform Actions
pathogen_decision_engine-1.3.1-py3-none-any.whl Python 3 none any Details for pathogen_decision_engine-1.3.1-py3-none-any.whl

Total release size: 12.0 kB

Release files / pathogen_decision_engine-1.3.1.tar.gz

Download URL pathogen_decision_engine-1.3.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a3ac0bd63c756e167d6ced51961ef0ae8c9dbcf7abc9c1ee9953b0f976473d3b
BLAKE2b-256 checksum
How to use checksums
6fe2e750c5af47045fa8e1682a211eec11528b4512410685182ff66c2a107b9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.14

Release files / pathogen_decision_engine-1.3.1-py3-none-any.whl

Download URL pathogen_decision_engine-1.3.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1c198ae6defb1c0c9e0d59d0792ed696efd07ab3c53c0a440ca3677a3e3d810
BLAKE2b-256 checksum
How to use checksums
1852cf305a932e2e00fe2b25dc6d3e63d2c1e5054c7948ac163085f5b398977e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.14

Security for pathogen-decision-engine 1.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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