Skip to main content

pythonFLEX 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

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

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

pythonflex-0.4.tar.gz (2.8 MB view details)

Uploaded Source

Built Distribution

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

pythonflex-0.4-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

File details

Details for the file pythonflex-0.4.tar.gz.

File metadata

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

File hashes

Hashes for pythonflex-0.4.tar.gz
Algorithm Hash digest
SHA256 f04f366ba69083b801726e8c46c3feaab15b97a29b1d33f596b645c1483d89be
MD5 eabcf55068aadd061bbf4f3d434d8a0f
BLAKE2b-256 c356eef66cb1288ada69dd34abde535a5317250145be9b8cbbc1c3e3b1e524b1

See more details on using hashes here.

File details

Details for the file pythonflex-0.4-py3-none-any.whl.

File metadata

  • Download URL: pythonflex-0.4-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 pythonflex-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3741a9b6b38e9fd3e7801b718c2fecf004d203b371617ef21cfaf0b94e41d326
MD5 e8764d1b8645327af4b6e5c3a8eb7b1a
BLAKE2b-256 d4c19e9300394daad928d59e4129a0de4efb16d7e3afa23059ba1e9b3935cbe5

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