Skip to main content

No project description provided

Project description

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.

Installation

You can install the package via pip:

pip install pathogen-decision-engine

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 table.csv --input_dict '{"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].

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

Details for the file pathogen_decision_engine-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pathogen_decision_engine-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d29626b7cbc103a3c18dba1b74738a2251702895e2714ec47a94ee56f2cfad47
MD5 ba5d25730f13eec3d1fd9bf3e01350fe
BLAKE2b-256 1e94ff1225687be7d0fe5bb43015ec72b3ec4e9d0ae650bd12c0e8fde1e0cce7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page