hammerlab / cytokit

Microscopy Image Cytometry Toolkit
Apache License 2.0
115 stars 18 forks source link

Difficulties running cytokit on codex data #18

Open jesusdpa1 opened 4 years ago

jesusdpa1 commented 4 years ago

Hi,

I am trying to run cytokit on our acquired data, but I am not able to set up the ylam correctly nor the processing bash file. we ran 9 group of antibodies, 10 Z planes and 49 sections

Here is what I got:

YLAM

experiment.txt

SH

pipeline_execution.txt

Error

image

jesusdpa1 commented 4 years ago

Update:

Manage to debug some errors I had in the code, but started getting the following error: when using the following pipeline.sh

!/usr/bin/env bash

bash -e /lab/repos/cytokit/pub/analysis/codex-spleen/pipeline_execution.sh

Ignore warnings relating to how the CODEX tif files were originally saved

export PYTHONWARNINGS='ignore::FutureWarning:h5py,ignore:ImageJ tags do not contain "axes" property:UserWarning:main'

DATA_DIR=/lab/data/images/src_CX_19-002_spleen_CC2-A/ BASE_CONF=/lab/data/config/experiment.yaml

Generate configurations for experiment variants

v00: Process data as-is with CellProfiler quantification (and DB export for CPA)

v01: Run with drift compensation and deconvolution (primarily for performance benchmarking)

cytokit config editor --base-config-path=$BASE_CONF --output-dir=/lab/data/images/output \ add analysis '{"cellprofiler_quantification": {"export_db": True, "export_csv": True, "export_db_objects_separately": True}}' \ set environment.path_formats "get_default_path_formats('cyc{cycle:03d}reg001/{region:d}{tile:05d}_Z{z:03d}_CH{channel:d}.tif')" \ set processor.args.run_drift_comp True \ set processor.args.run_deconvolution True \ save_variant v00/config reset \ exit

OUTPUT_DIR=/lab/data/images/output/$VARIANT CONFIG_DIR=/lab/data/images/output/v00/config/experiment.yaml echo "Processing experiment $EXPERIMENT (variant = $VARIANT, config = $CONFIG_DIR)"

Note here that the data dir for the processor command is equal to output dir

echo "Running analysis" cytokit processor run_all --config-path=$CONFIG_DIR --data-dir=$DATA_DIR --output-dir=$OUTPUT_DIR

image

When changing the data-dir in the pipeline:

cytokit processor run_all --config-path=$CONFIG_DIR --data-dir=$OUTPUT_DIR --output-dir=$OUTPUT_DIR

image

Thanks in advance for your help,

eric-czech commented 4 years ago

Ah, you should change "run_tile_generator: false" in the config to "run_tile_generator: true" if you're running on your own data. I updated that config to have a comment in the future for anyone else that copies it. Turning that off is only necessary when you can't get raw images for an experiment (as was the case with the CODEX publication) and have to use assembled hyperstacks instead, which is almost never, so there should have definitely been a comment about it.

Also, I'd suggest:

jesusdpa1 commented 4 years ago

Hi Eric,

Thank you very much! I'll do the modifications to the path. After changing "run_tile_generator: true" it started working but gave me the following error:

image

image

from my experience I know that RTX have a problem handling memory allocation. The way I have been able to solve this problem is by limiting the usage of the memory to 0.8 of the total memory with

config = tf.ConfigProto() config.gpu_options.per_process_gpu_memory_fraction = 0.8 session = tf.Session(config=config)

is it possible to do this with cytokit? Do you think that I am presenting another problem?

pipeline_execution.txt

experiment.txt

jesusdpa1 commented 4 years ago

Solved it. Had a bad math calculation

previous = tile_height: 1007 -> now = tile_height: 1008

But got the problem I was expecting on the GPU memory

image

eric-czech commented 4 years ago

Hi @jesusdpa1 ,

A couple thoughts:

jesusdpa1 commented 4 years ago

Hi Eric,

Thank you very much! everything help, the program is now running smoothly,