Skip to main content

pflex is a benchmarking toolkit for evaluating CRISPR screen results against biological gold standards. The toolkit computes gene-level and complex-level performance metrics, helping researchers systematically assess the biological relevance and resolution of their CRISPR screening data.

Project description

pflex

PyPI Python License Build Build system Lint CLI

pflex is a benchmarking toolkit for evaluating CRISPR screen results against biological gold standards. It provides precision-recall analysis using reference gene sets from CORUM protein complexes, Gene Ontology Biological Processes (GO-BP), KEGG pathways, and other curated resources. The toolkit computes gene-level and complex-level performance metrics, helping researchers systematically assess the biological relevance and resolution of their CRISPR screening data.


Features

  • Precision-recall curve generation for ranked gene lists
  • Evaluation using CORUM complexes, GO terms, pathways
  • Complex-level resolution analysis and visualization
  • Easy integration into CRISPR screen workflows

Installation

Suggested to use Python version 3.10 with virtual env.

Create venv:

conda create -n p310 python=3.10
conda activate p310
pip install uv

Install pflex via pip:

uv pip install pflex

or:

pip install pflex

or install pflex via git to develop the package locally:

git clone https://github.com/tyasird/pflex.git
cd pflex
uv pip install -e .

Quickstart

import pflex as flex

inputs = {
    "Melanoma (63 Screens)": {
        "path": flex.get_example_data_path("melanoma_cell_lines_500_genes.csv"),
        "sort": "high",
        "color": "#FF0000",
    },
    "Liver (24 Screens)": {
        "path": flex.get_example_data_path("liver_cell_lines_500_genes.csv"),
        "sort": "high",
        "color": "#FFDD00",
    },
    "Neuroblastoma (37 Screens)": {
        "path": flex.get_example_data_path("neuroblastoma_cell_lines_500_genes.csv"),
        "sort": "high",
        "color": "#FFDDDD",
    },
}

default_config = {
    "min_genes_in_complex": 0,
    "min_genes_per_complex_analysis": 3,
    "output_folder": "CORUM",
    "gold_standard": "CORUM",
    "color_map": "BuGn",
    "jaccard": False,
    "use_common_genes": False,
    "plotting": {
        "save_plot": True,
        "output_type": "png",
    },
    "preprocessing": {
        "fill_na": True,
        "normalize": False,
    },
    "corr_function": "numpy",
    "logging": {
        "visible_levels": ["DONE"],
    },
}

flex.initialize(default_config)

data, _ = flex.load_datasets(inputs)
terms, genes_in_terms = flex.load_gold_standard()

for name, dataset in data.items():
    pra = flex.pra(name, dataset, is_corr=False)
    fpc = flex.pra_percomplex(name, dataset, is_corr=False)
    cc = flex.complex_contributions(name)
    flex.mpr_prepare(name)

flex.plot_precision_recall_curve()
flex.plot_auc_scores()
flex.plot_significant_complexes()
flex.plot_percomplex_scatter(n_top=20)
flex.plot_percomplex_scatter_bysize()
flex.plot_complex_contributions()
flex.plot_mpr_tp_multi()
flex.plot_mpr_complexes_multi()
flex.save_results_to_csv()

Examples


License

MIT

Project details


Download files

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

Source Distribution

pflex-1.0.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pflex-1.0-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

File details

Details for the file pflex-1.0.tar.gz.

File metadata

  • Download URL: pflex-1.0.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for pflex-1.0.tar.gz
Algorithm Hash digest
SHA256 f3d7d6a36bcc57cbd223bef2edc6e6fced5a7311a5b8c666b102d36c3b0882e5
MD5 ee8fec89c8d785640c3697614aa687e1
BLAKE2b-256 15b83e3a0131bb268c1d6fcb4fc468e46c75c034824b396b21142804154cb501

See more details on using hashes here.

File details

Details for the file pflex-1.0-py3-none-any.whl.

File metadata

  • Download URL: pflex-1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for pflex-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e8c80074e4b2ba91dc8fc24166392db3dd3addef4a42dbf3be6d7f0b16b0e04
MD5 be8226088088ed747493b7e1a9dee1c5
BLAKE2b-256 09f8100bb42fcc770dfeec61350a349a201ba95304fb609315479e60a1ca2469

See more details on using hashes here.

Supported by

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