Running cellprofiler 2.0 on linux cluster

Hello,

After successfully setting up Cellprofiler/CPCluster, I am now trying to set up Cell Profiler 2.0 to run on our cluster. So far, so good, the software and libraries are installed and the program runs. Now, I am intending to modify the Batchrunner.pl script from the previous CPCluster release to run with Cell Profiler 2.0

The problem I observe is the Batch_data.mat data structure in Cell Profiler 2.0

from Batchrunner.pl:
batch_info = loadmat("%(datadir)s/Batch_data.mat"%(locals()))
num_sets = batch_info’handles’].Current.NumberOfImageSets

Now, I need to change the variables to correctly grab the number of image sets from Batch_data.mat. What should the new variable names be to get the right number?

Chuck

You can probably reverse-engineer it from our BatchProfiler code.
svnrepos.broadinstitute.org/Cel … hProfiler/

Look at NewBatch.py, in particular.

The basic code is like this:

import cellprofiler.pipeline as cpp
pipeline = cpp.Pipeline()
pipeline.load(filename)
image_set_list = pipeline.prepare_run(None)

Hi, thouis

Thanks for your help. I modified BatchRunner.pl to find the number of images from the pipeline, which for our system is in the same directory with our Batch_data.mat file. I name this with the variable data_dir below. I added these lines to calculate num_sets:

import glob
import cellprofiler.pipeline as cpp
pipeline = cpp.Pipeline()
pipeline.load(glob.glob("%(data_dir)s/*.cp"%(locals()))[0])
num_sets=pipeline.prepare_run(None).count()

The count and load methods come from the cellprofiler/pipeline module. glob was needed to match the first found pipeline name.

Thanks!
Chuck