Batch commands error

Dear all,

I’ve been trying to use CellProfiler (2.1.1) in batch mode and I’ve encountered a problem when running following commands specified by --get-batch-commands option. For a trivial example (3 images, no grouping, just IdentifyPrimaryObjects module) I get commands:

CellProfiler -c -r -b -p /home/krab1k/Batch_data.h5 -g ImageNumber=1
CellProfiler -c -r -b -p /home/krab1k/Batch_data.h5 -g ImageNumber=2
CellProfiler -c -r -b -p /home/krab1k/Batch_data.h5 -g ImageNumber=3

However, any of these gives me the error:

Uncaught exception in CellProfiler.py
Traceback (most recent call last):
  File "CellProfiler.py", line 249, in main
    run_pipeline_headless(options, args)
  File "CellProfiler.py", line 826, in run_pipeline_headless
    initial_measurements = initial_measurements)
  File "/home/krab1k/Tmp/CellProfiler-2.1.1/cellprofiler/pipeline.py", line 1630, in run
    initial_measurements = measurements):
  File "/home/krab1k/Tmp/CellProfiler-2.1.1/cellprofiler/pipeline.py", line 1740, in run_with_yield
    in group(workspace):
  File "/home/krab1k/Tmp/CellProfiler-2.1.1/cellprofiler/pipeline.py", line 1658, in group
    ", ".join(grouping.keys()), ", ".join(keys)))
ValueError: The grouping keys specified on the command line (ImageNumber) must be the same as those defined by the modules in the pipeline ()

Am I doing something wrong, or it’s really a bug? :wink:

Thank you for help!
Tomáš

Hello Tomáš,

Not sure what the issue is, but you might best try the -f and -l switches instead of the -g switch (which is meant for groups and you apparently have none).
Some more info here on these switches:
github.com/CellProfiler/CellPro … nvironment

It’s also possible that there was a bug that was fixed, e.g.:
github.com/CellProfiler/CellPro … ssues/1254
So if you are still having trouble, try a newer trunk build: cellprofiler.org/cgi-bin/trunk_build.cgi

Hope that helps,
David

Hello David,

thanks for the suggestions. However, I came across several difficulties when trying to use trunk version. I’ve noticed that javabridge is now a separate project, unfortunately I am not able to install it. If I use pip or easy_install I end up with:
fi.muni.cz/~xracek/tmp/error1.txt
If I try to use version from git and run “python2 setup.py build” I get the following instead:
fi.muni.cz/~xracek/tmp/error2.txt

Do you have any idea where the problem might be?

(I tried to apply the patch from the issue you mentioned on 2.1.1 release, but that seemed to have no effect on the aforementioned problem.)

My main goal is write a script which takes Batch_data.h5 file and creates tasks which can be processed independently of each other for the jobs submission system (PBS in particular). That is no matter what pipeline user created (assuming it’s correct), to be able to generate CellProfiler commands from the batch file. I guess the number of “jobs/groups/images/whatever” should be enough (How do I get it?) if then I use -f and -l switches as you suggested. Am I right?

Thank you very much for your effort,
Tomáš

I notice that for the 1st error, it reports that the java_home variable is not set, whereas for the 2nd error, it is. Would you able to set it and try pip again?
-Mark