Git Product home page Git Product logo

opticalpooledscreens's Introduction

Optical Pooled Screens

Analysis resources for the publication Pooled genetic perturbation screens with image-based phenotypes. This is an updated and expanded version of the repository for the original 2019 publication Optical pooled screens in human cells, available here.

Installation (OSX)

Download the repository (e.g., on Github use the green "Clone or download" button, then "Download ZIP").

In Terminal, go to the OpticalPooledScreens project directory and create a Python 3 virtual environment using a command like:

python3 -m venv venv

If the python3 command isn't available, you might need to specify the full path. E.g., if Miniconda is installed in the home directory:

~/miniconda3/bin/python -m venv venv

This creates a virtual environment called venv for project-specific resources. The commands in install.sh add required packages to the virtual environment:

sh install.sh

Within this script, the ops package is installed with pip install -e, so the source code in the ops/ directory can be modified in place.

Once install is complete, activate the virtual environment from the project directory:

source venv/bin/activate

Additionally, if using the CellPose segmentation method, this must be installed in the virtual environment:

pip install cellpose[gui]

Running an example pipeline

To run the analysis pipeline with images from the original publication, first download and install the IBM Aspera Command Line Interface (includes ascp) for interaction with the Cell-IDR databse. Then, set up an example directory:

python -m ops.paper.cell_idr setup_example example --ascp=<path/to/ascp/executable>

Note that if ascp is in your path, you can use --ascp==ascp.

Run the pipeline on the example data using snakemake (after activating the virtual environment):

cd example
snakemake --cores all --configfile=config.yaml

Additional example data

An example tile of 12-cycle SBS data is available in the original OpticalPooledScreens repository here.

Additionally, all screening data presented in the original publication can be easily accessed from the public Cell-IDR database (study idr0071) using ascp similar to above for the example pipeline:

python -m ops.paper.cell_idr get_cell_idr \
<destination> \
--experiment=<experiment> \
--well=<well> \
--tile=<tile> \
--ascp=<path/to/ascp/executable>

The following experiments are available:

Cell-IDR experiment Dataset
A static p65-mNeonGreen screen in HeLa cells
B static p65 antibody screen in HeLa cells
C static p65 antibody screen in A549 cells
D static p65 antibody screen in HCT-116 cells
E Frameshift reporter screen in HeLa cells
F Detection of combinatorial perturbations in HeLa cells

Both well and tile can be set to all to download the full dataset. Figures 3 & 4 in the Nature Protocols manuscript were made using data from experiment C; functions for reproducing these figures are available here.

opticalpooledscreens's People

Contributors

et-jaynes-in-a-banana-suit avatar lukebfunk avatar feldman4 avatar

Stargazers

 avatar Neil avatar Jun Yoon avatar Easin Syed avatar Amulya Garimella avatar Samir Amin avatar Hao He avatar  avatar Peter DeWeirdt avatar Jake Qiu avatar

Watchers

James Cloos avatar Theresa Swayne avatar  avatar  avatar

opticalpooledscreens's Issues

Upgrade scikit-image to >=0.19.3 in requirements.txt

Hi,

The current version of scikit-image listed in the requirements file has a bug in phase_cross_correlation. This can lead to unexpected results in the alignment of SBS cycle images.

Specifically, in my experience the values after registration are not always in the expected range although the alignment would appear fine.

Please see scikit-image/scikit-image#5461 and the issues linked to the same pull request.

However, also note scikit-image/scikit-image#6456

Thank you,
NelsonGon

Running example pipeline

(ops) ~/code/OpticalPooledScreens$ python -m ops.paper.cell_idr setup_example example --ascp=ascp
Linked barcodes.csv
Linked config.yaml
Linked Snakefile
Traceback (most recent call last):
  File "/Users/gouldj2/miniconda3/envs/ops/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/gouldj2/miniconda3/envs/ops/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/gouldj2/code/OpticalPooledScreens/ops/paper/cell_idr.py", line 132, in <module>
    fire.Fire(commands)
  File "/Users/gouldj2/miniconda3/envs/ops/lib/python3.10/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/Users/gouldj2/miniconda3/envs/ops/lib/python3.10/site-packages/fire/core.py", line 466, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/Users/gouldj2/miniconda3/envs/ops/lib/python3.10/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/Users/gouldj2/code/OpticalPooledScreens/ops/paper/cell_idr.py", line 106, in setup_example
    get_cell_idr(directory, well=well, tile=tile, ascp=ascp)
  File "/Users/gouldj2/code/OpticalPooledScreens/ops/paper/cell_idr.py", line 61, in get_cell_idr
    raise ValueError('No valid tiles specified for the chosen experiment.')
ValueError: No valid tiles specified for the chosen experiment.

Issue with Setting Up Example Directory in OpticalPooledScreens

Hello,

I am currently facing an issue with setting up the example data in the OpticalPooledScreens repository.
Although the example directory is created successfully, the sub-directory exampleC is not being created, which is hindering further analysis.
The command I am using is:
python -m ops.paper.cell_idr setup_example example --ascp=ascp

Everything seems to work fine until the script attempts to download.
However, I encounter an error stating that a certain file or directory is missing.
The specific error message is as follows:
FileNotFoundError: [Errno 2] No such file or directory: 'example/experimentC/well_tile_list_example.csv'

From this error, it appears that the example/experimentC directory is either not being created or is missing, which causes the script to fail when trying to access the well_tile_list_example.csv file.

I suspect there might have been changes to the file locations, or perhaps there is a bug in the script.
Could you please provide some guidance on how to resolve this issue?
If there's any more information or logs you need, I am happy to provide them.

Thank you for your assistance.

Best regards,
Hikiami

Unicode-related bug?

Hello,

I'm having trouble with Step 132 of Pooled genetic perturbation screens with image-based phenotypes (https://pubmed.ncbi.nlm.nih.gov/35022620/), which states: 'From within the experiment folder, execute the ops.io.format_input function to format the input files:'

I've adjusted the image file names in accordance with the sample 'input_files', in which no edits have been made, but I'm encountering the same error. I suspect there might be a Unicode-related bug. If you have any suggestions or solutions, I would greatly appreciate your guidance.

Here's the code I'm using:

python -m ops.io format_input input_files.xlsx --n_jobs=1
/Users/username/OpticalPooledScreens37/ops/io.py:129: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
if data.dtype == np.bool:
Traceback (most recent call last):
File "/Users/username/opt/anaconda3/envs/snakes37/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/Users/username/opt/anaconda3/envs/snakes37/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/username/OpticalPooledScreens37/ops/io.py", line 377, in
fire.Fire(commands)
File "/Users/username/OpticalPooledScreens37/venv/lib/python3.7/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/Users/username/OpticalPooledScreens37/venv/lib/python3.7/site-packages/fire/core.py", line 471, in _Fire
target=component.name)
File "/Users/username/OpticalPooledScreens37/venv/lib/python3.7/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/Users/username/OpticalPooledScreens37/ops/io.py", line 261, in format_input
process_site(output_file,df_input)
File "/Users/username/OpticalPooledScreens37/ops/io.py", line 253, in process_site
save_stack(output_file,stacked)
File "/Users/username/OpticalPooledScreens37/ops/io.py", line 176, in save_stack
tag_50839 = ij_tag_50839(luts, display_ranges)
File "/Users/username/OpticalPooledScreens37/ops/io.py", line 349, in ij_tag_50839
]).encode('ascii') + d
UnicodeEncodeError: 'ascii' codec can't encode character '\u0546' in position 16: ordinal not in range(128)

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.