PlateViewer 3.0 ValueError

cellprofiler

#1

Hello,

I am trying to import a property file generated by CellProfiler 2.2 ‘export to SQLite database’ module into CellProfiler Analyst 2.0. I have tried the example CPA file from the official website tutorial, and it loaded with no problem. I’m running on a Windows 10 64-bit system.

Thanks a lot for your help!


PlateViewer fails to open with the following error:

An error occurred in the program:
ValueError: max() arg is an empty sequence

Traceback (most recent call last):
File “cpa.py”, line 266, in launch_plate_map_browser
File “plateviewer.pyc”, line 171, in init
File “plateviewer.pyc”, line 368, in OnSelectMeasurement
File “plateviewer.pyc”, line 271, in UpdatePlateMaps
File “plateviewer.pyc”, line 687, in FormatPlateMapData


Properties file outputs as below:

#Thu Jan 24 12:31:34 2019

==============================================

CellProfiler Analyst 2.0 properties file

==============================================

==== Database Info ====

db_type = sqlite
db_sqlite_file = C:\Week1_22141\2_analysis_SQLite\MCF7

==== Database Tables ====

image_table = Per_Image
object_table = Per_Object

==== Database Columns ====

image_id = ImageNumber
object_id = ObjectNumber
plate_id = Image_Metadata_Plate
well_id = Image_Metadata_Well

Also specify the column names that contain X and Y coordinates for each

object within an image.

cell_x_loc = Nuclei_Location_Center_X
cell_y_loc = Nuclei_Location_Center_Y

==== Image Path and File Name Columns ====

image_path_cols = Image_PathName_Actin,Image_PathName_ActinIllum,Image_PathName_CellOutline,Image_PathName_DAPI,Image_PathName_DAPIIllum,Image_PathName_TubIllum,Image_PathName_Tubulin
image_file_cols = Image_FileName_Actin,Image_FileName_ActinIllum,Image_FileName_CellOutline,Image_FileName_DAPI,Image_FileName_DAPIIllum,Image_FileName_TubIllum,Image_FileName_Tubulin

CPA will now read image thumbnails directly from the database, if chosen in ExportToDatabase.

image_thumbnail_cols = Image_Thumbnail_Actin,Image_Thumbnail_CellOutline,Image_Thumbnail_DAPI,Image_Thumbnail_Tubulin

Give short names for each of the channels (respectively)…

image_names = Actin,ActinIllum,CellOutline,DAPI,DAPIIllum,TubIllum,Tubulin

Specify a default color for each of the channels (respectively)

image_channel_colors = red, green, blue, cyan, magenta, yellow, gray

==== Image Accesss Info ====

image_url_prepend =

==== Dynamic Groups ====

==== Image Filters ====

==== Meta data ====

object_name = cell, cells,

plate_type = 96

==== Excluded Columns ====

OPTIONAL

classifier_ignore_columns = table_number_key_column, image_number_key_column, object_number_key_column

==== Other ====

image_tile_size = 50

======== Auto Load Training Set ========

training_set =

======== Area Based Scoring ========

area_scoring_column =

======== Output Per-Object Classes ========

class_table = MOA

======== Check Tables ========

check_tables = yes


The pipeline I used was adapted from a published pipeline:
Singh S, Bray MA, Jones TR, Carpenter AE (2014). Pipeline for illumination correction of images for high-throughput microscopy. Journal of Microscopy 256(3):231-6 / doi. PMID: 25228240


#2

Hi,

Can you confirm your plate really was a 96 well plate, and that Image_Metadata_Plate and Image_Metadata_Well are indeed present in your database and look to have correct values? Those are the most likely sources of error.

If not any of that, can you send along your database (or a toy database made from the same pipeline and one or two image sets?


#3

Hello Beth,

Thanks for your quick response!

I have double-checked that Image_Metadata_Plate and Image_Metadata_Well are the correct column names in the database file, and the plate should be a 96 well plate (ranging from well B02-G11).

Please see the attached SQLite and pipeline files I processed, with images of the processed illumination correction function files and one example well. Analysis_posneg_withICFs_Median500M.cpproj (1.7 MB)
MCF7.properties (6.6 KB)
MCF7_SQL.zip (17.3 KB)
example_images.zip (15.3 MB)


#4

Hi,

I think this is actually a red herring- the example database you sent me was empty (it had columns, but no data written in the rows), and every time I try to run your pipeline in Windows 10 with CP2.1.1 on your sample data I get a NamesAndTypes error and an empty database. I think the PlateViewer error is reflecting that fact (there is no data). I think this is the issue you’re having.

Strangely enough, when I try to run it in CP2.2, it runs fine- is running CP2.2 rather than 2.1.1 an option? 2.1.1 is old and no longer supported, so even if we found a bug that explained why your image sets didn’t load we wouldn’t be able to fix it.


#5

Hello Beth,

Thanks a lot for running the files I sent you!

I also tried CellProfiler 3.1, but CPA could not import the SQL file generated by CP3.1 either.

I followed your instruction to try CP2.2, but I ran into some error when trying to start CP2.2 (shown below). I’ve seen some posts about similar errors. Is there anything I can try to get it to work?

Plugin directory doesn’t point to valid folder: D:\CellProfiler\plugins
java.lang.IllegalArgumentException: Cannot handle replace call to list in ij.Menus’s public static synchronized java.lang.String getPlugins()
at net.imagej.patcher.CodeHacker.replaceCallInMethod(CodeHacker.java:725)
at net.imagej.patcher.CodeHacker.replaceCallInMethod(CodeHacker.java:650)
at net.imagej.patcher.LegacyExtensions.addExtraPlugins(LegacyExtensions.java:477)
at net.imagej.patcher.LegacyExtensions.injectHooks(LegacyExtensions.java:175)
at net.imagej.patcher.LegacyInjector.inject(LegacyInjector.java:308)
at net.imagej.patcher.LegacyInjector.injectHooks(LegacyInjector.java:109)
at net.imagej.patcher.LegacyEnvironment.initialize(LegacyEnvironment.java:101)
at net.imagej.patcher.LegacyEnvironment.applyPatches(LegacyEnvironment.java:495)
at net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:397)
at net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:376)
at net.imagej.patcher.JavaAgent.preinit(JavaAgent.java:147)
at net.imagej.patcher.JavaAgent.premain(JavaAgent.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown Source)
Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 15
at javassist.CtClassType.getClassFile2(CtClassType.java:203)
at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:110)
at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:96)
at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:704)
at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:681)
at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:156)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45)
at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:241)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:329)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
at javassist.compiler.CodeGen.atIfStmnt(CodeGen.java:390)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:354)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
at javassist.compiler.Javac.compileStmnt(Javac.java:568)
at javassist.expr.MethodCall.replace(MethodCall.java:234)
at net.imagej.patcher.CodeHacker$7.edit(CodeHacker.java:686)
at javassist.expr.ExprEditor.loopBody(ExprEditor.java:191)
at javassist.expr.ExprEditor.doit(ExprEditor.java:90)
at javassist.CtBehavior.instrument(CtBehavior.java:618)
at net.imagej.patcher.CodeHacker$EagerExprEditor.instrument(CodeHacker.java:1278)
at net.imagej.patcher.CodeHacker.replaceCallInMethod(CodeHacker.java:670)
… 17 more
Caused by: java.io.IOException: invalid constant type: 15
at javassist.bytecode.ConstPool.readOne(ConstPool.java:1027)
at javassist.bytecode.ConstPool.read(ConstPool.java:970)
at javassist.bytecode.ConstPool.(ConstPool.java:127)
at javassist.bytecode.ClassFile.read(ClassFile.java:693)
at javassist.bytecode.ClassFile.(ClassFile.java:85)
at javassist.CtClassType.getClassFile2(CtClassType.java:190)
… 37 more
java.lang.IllegalArgumentException: Cannot handle app name in ij.ImageJ’s public (java.applet.Applet applet, int mode)
at net.imagej.patcher.CodeHacker.replaceAppNameInCall(CodeHacker.java:446)
at net.imagej.patcher.LegacyExtensions.insertAppNameHooks(LegacyExtensions.java:406)
at net.imagej.patcher.LegacyExtensions.injectHooks(LegacyExtensions.java:291)
at net.imagej.patcher.LegacyInjector.inject(LegacyInjector.java:308)
at net.imagej.patcher.LegacyInjector.injectHooks(LegacyInjector.java:109)
at net.imagej.patcher.LegacyEnvironment.initialize(LegacyEnvironment.java:101)
at net.imagej.patcher.LegacyEnvironment.applyPatches(LegacyEnvironment.java:495)
at net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:397)
at net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:376)
at net.imagej.patcher.JavaAgent.preinit(JavaAgent.java:147)
at net.imagej.patcher.JavaAgent.premain(JavaAgent.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown Source)
Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 15
at javassist.CtClassType.getClassFile2(CtClassType.java:203)
at javassist.CtClassType.subtypeOf(CtClassType.java:303)
at javassist.CtClassType.subtypeOf(CtClassType.java:318)
at javassist.compiler.MemberResolver.compareSignature(MemberResolver.java:247)
at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:119)
at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:96)
at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:704)
at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:681)
at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:156)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45)
at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:241)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:329)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
at javassist.compiler.Javac.compileStmnt(Javac.java:568)
at javassist.expr.MethodCall.replace(MethodCall.java:234)
at net.imagej.patcher.CodeHacker$4.edit(CodeHacker.java:427)
at net.imagej.patcher.CodeHacker$4.edit(CodeHacker.java:441)
at javassist.expr.ExprEditor.loopBody(ExprEditor.java:219)
at javassist.expr.ExprEditor.doit(ExprEditor.java:90)
at javassist.CtBehavior.instrument(CtBehavior.java:618)
at net.imagej.patcher.CodeHacker$EagerExprEditor.instrument(CodeHacker.java:1278)
at net.imagej.patcher.CodeHacker.replaceAppNameInCall(CodeHacker.java:402)
… 16 more
Caused by: java.io.IOException: invalid constant type: 15
at javassist.bytecode.ConstPool.readOne(ConstPool.java:1027)
at javassist.bytecode.ConstPool.read(ConstPool.java:970)
at javassist.bytecode.ConstPool.(ConstPool.java:127)
at javassist.bytecode.ClassFile.read(ClassFile.java:693)
at javassist.bytecode.ClassFile.(ClassFile.java:85)
at javassist.CtClassType.getClassFile2(CtClassType.java:190)
… 37 more
WARNING: Unable to load module ‘vigra.fourier’
ilastik import: failed to import the ilastik. Please follow the instructions on
http://www.ilastik.org” to install ilastik
Traceback (most recent call last):
File “cellprofiler\modules\ilastik_pixel_classification.pyc”, line 70, in
ImportError: No module named ilastik_main
Could not load cellprofiler.modules.exporttocellh5
Traceback (most recent call last):
File “cellprofiler\modules_init_.pyc”, line 294, in add_module
File “cellprofiler\modules\exporttocellh5.pyc”, line 29, in
File “cellh5_init_.pyc”, line 12, in
File “cellh5\cellh5.pyc”, line 18, in
File “matplotlib\pyplot.pyc”, line 29, in
File “matplotlib\colorbar.pyc”, line 34, in
File “matplotlib\collections.pyc”, line 27, in
File “matplotlib\backend_bases.pyc”, line 62, in
File “matplotlib\textpath.pyc”, line 15, in
File “matplotlib\font_manager.pyc”, line 1420, in
File “matplotlib\font_manager.pyc”, line 1407, in _rebuild
File “matplotlib\font_manager.pyc”, line 955, in pickle_dump
IOError: [Errno 13] Permission denied:


#6

Your pipeline works fine in 3.1.8 in my hands to run in CPA. Can you check if your database does indeed have measurements written to it?