Skip to main content

pythonFLEX

🧬 pythonFLEX 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 pythonFLEX via pip

uv pip install pythonflex

or

pip install pythonflex

or Install pythonFLEX via git (to develop package in local)

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

🚀 Quickstart

import pythonflex as flex

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



default_config = {
    "min_genes_in_complex": 2,
    "min_genes_per_complex_analysis": 2,
    "output_folder": "output",
    "gold_standard": "GOBP",
    "color_map": "RdYlBu",
    "jaccard": True,
    # Which genes define the evaluated space:
    # - 'common'  : intersect terms with genes common across datasets
    # - 'dataset' : intersect terms with genes present in each dataset
    "analysis_genes": "common",
    "plotting": {
        "save_plot": True,
        "output_type": "png",
    },
    "preprocessing": {
        "fill_na": True,
        "normalize": False,
    },
    "corr_function": "numpy",
    "logging": {  
        "visible_levels": ["DONE","INFO", "WARNING"]  # "PROGRESS", "STARTED", ,"INFO","WARNING"
    }
}


# Initialize logger, config, and output folder
flex.initialize(default_config)

# Load datasets and gold standard terms
data, _ = flex.load_datasets(inputs)
terms, genes_in_terms = flex.load_gold_standard()

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

# Generate plots
flex.plot_auc_scores()
flex.plot_precision_recall_curve()
flex.plot_percomplex_scatter()
flex.plot_percomplex_scatter_bysize()
flex.plot_significant_complexes()
flex.plot_complex_contributions()
flex.plot_mpr_summary(variants="unfiltered")

flex.save_results_to_csv()

📂 Examples


📃 License

MIT

Metadata

Release files for pythonflex 0.4

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

Source distribution (sdist)

Source distribution for pythonflex 0.4
File Size Uploaded Provenance Actions
pythonflex-0.4.tar.gz 2.8 MB Without provenance Details for pythonflex-0.4.tar.gz

Built distribution (wheel)

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

Total release size: 5.4 MB

Release files / pythonflex-0.4.tar.gz

Download URL pythonflex-0.4.tar.gz
Size 2.8 MB
Tags Source
SHA-256 checksum
How to use checksums
f04f366ba69083b801726e8c46c3feaab15b97a29b1d33f596b645c1483d89be
BLAKE2b-256 checksum
How to use checksums
c356eef66cb1288ada69dd34abde535a5317250145be9b8cbbc1c3e3b1e524b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.5

Release files / pythonflex-0.4-py3-none-any.whl

Download URL pythonflex-0.4-py3-none-any.whl
Size 2.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3741a9b6b38e9fd3e7801b718c2fecf004d203b371617ef21cfaf0b94e41d326
BLAKE2b-256 checksum
How to use checksums
d4c19e9300394daad928d59e4129a0de4efb16d7e3afa23059ba1e9b3935cbe5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.5

Security for pythonflex 0.4

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