Unable to open properties file in CellProfiler Analyst

Hi all, I am a new CellProfiler Analyst user. I am having issues opening the properties file generated with CellProfiler using the ExportToDatabase module. I try to open it with CellProfiler Analyst and the program closes. I believe that CellProfiler Analyst is working properly, so I am assuming that there is an issue with my properties file. I have attached my properties file below, and would love any suggestions for how to fix this!

#Wed Jan 22 15:04:47 2020
# ==============================================
#
# CellProfiler Analyst 2.0 properties file
#
# ==============================================

# ==== Database Info ====
db_type         = sqlite
db_sqlite_file  = C:\Users\shobi\Desktop\CP_Output\NPuntx.db

# ==== Database Tables ====
image_table   = NPuntx_Per_Image
object_table  = NPuntx_Per_Object

# ==== Database Columns ====
# Specify the database column names that contain unique IDs for images and
# objects (and optionally tables).
#
# table_id (OPTIONAL): This field lets Classifier handle multiple tables if
#          you merge them into one and add a table_number column as a foreign
#          key to your per-image and per-object tables.
# image_id: must be a foreign key column between your per-image and per-object
#           tables
# object_id: the object key column from your per-object table

image_id      = ImageNumber
object_id     = ObjectNumber
plate_id      = 
well_id       = 
series_id     = Image_Group_Number
group_id      = Image_Group_Number
timepoint_id  = Image_Group_Index

# Also specify the column names that contain X and Y coordinates for each
# object within an image.
cell_x_loc    = cells_grid_Location_Center_X
cell_y_loc    = cells_grid_Location_Center_Y

# ==== Image Path and File Name Columns ====
# Classifier needs to know where to find the images from your experiment.
# Specify the column names from your per-image table that contain the image
# paths and file names here.
#
# Individual image files are expected to be monochromatic and represent a single
# channel. However, any number of images may be combined by adding a new channel
# path and filename column to the per-image table of your database and then
# adding those column names here.
#
# Note that these lists must have equal length!
image_path_cols = Image_PathName_Brightfield,Image_PathName_TonEBP,Image_PathName_NFkB,Image_PathName_DRAQ,Image_PathName_Brightfield2
image_file_cols = Image_FileName_Brightfield,Image_FileName_TonEBP,Image_FileName_NFkB,Image_FileName_DRAQ,Image_FileName_Brightfield2

# CellProfiler Analyst will now read image thumbnails directly from the database, if chosen in ExportToDatabase.
image_thumbnail_cols = 

# Give short names for each of the channels (respectively)...
image_names = Brightfield,TonEBP,NFkB,DRAQ,Brightfield2

# Specify a default color for each of the channels (respectively)
# Valid colors are: [red, green, blue, magenta, cyan, yellow, gray, none]
image_channel_colors = 

# ==== Image Accesss Info ====
image_url_prepend = 

# ==== Dynamic Groups ====
# Here you can define groupings to choose from when classifier scores your experiment.  (e.g., per-well)
# This is OPTIONAL, you may leave "groups = ".
# FORMAT:
#   group_XXX  =  MySQL select statement that returns image-keys and group-keys.  This will be associated with the group name "XXX" from above.
# EXAMPLE GROUPS:
#   groups               =  Well, Gene, Well+Gene,
#   group_SQL_Well       =  SELECT Per_Image_Table.TableNumber, Per_Image_Table.ImageNumber, Per_Image_Table.well FROM Per_Image_Table
#   group_SQL_Gene       =  SELECT Per_Image_Table.TableNumber, Per_Image_Table.ImageNumber, Well_ID_Table.gene FROM Per_Image_Table, Well_ID_Table WHERE Per_Image_Table.well=Well_ID_Table.well
#   group_SQL_Well+Gene  =  SELECT Per_Image_Table.TableNumber, Per_Image_Table.ImageNumber, Well_ID_Table.well, Well_ID_Table.gene FROM Per_Image_Table, Well_ID_Table WHERE Per_Image_Table.well=Well_ID_Table.well

group_SQL_NPuntxcells = SELECT ImageNumber FROM NPuntx_Per_Image


# ==== Image Filters ====
# Here you can define image filters to let you select objects from a subset of your experiment when training the classifier.
# FORMAT:
#   filter_SQL_XXX  =  MySQL select statement that returns image keys you wish to filter out.  This will be associated with the filter name "XXX" from above.
# EXAMPLE FILTERS:
#   filters           =  EMPTY, CDKs,
#   filter_SQL_EMPTY  =  SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene="EMPTY"
#   filter_SQL_CDKs   =  SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene REGEXP 'CDK.*'



# ==== Meta data ====
# What are your objects called?
# FORMAT:
#   object_name  =  singular object name, plural object name,
object_name  =  cell, cells,

# What size plates were used?  96, 384 or 5600?  This is for use in the PlateViewer. Leave blank if none
plate_type  = 

# ==== Excluded Columns ====
# OPTIONAL
# Classifier uses columns in your per_object table to find rules. It will
# automatically ignore ID columns defined in table_id, image_id, and object_id
# as well as any columns that contain non-numeric data.
#
# Here you may list other columns in your per_object table that you wish the
# classifier to ignore when finding rules.
#
# You may also use regular expressions here to match more general column names.
#
# Example: classifier_ignore_columns = WellID, Meta_.*, .*_Position
#   This will ignore any column named "WellID", any columns that start with
#   "Meta_", and any columns that end in "_Position".
#
# A more restrictive example:
# classifier_ignore_columns = ImageNumber, ObjectNumber, .*Parent.*, .*Children.*, .*_Location_Center_.*,.*_Metadata_.*

classifier_ignore_columns  =  table_number_key_column, image_number_key_column, object_number_key_column

# ==== Other ====
# Specify the approximate diameter of your objects in pixels here.
image_tile_size   =  50

# Provides the image width and height. Used for per-image classification.
# If not set, it will be obtained from the Image_Width and Image_Height
# measurements in CellProfiler.

# image_width  = 1000
# image_height = 1000

# OPTIONAL
# Image Gallery can use a different tile size (in pixels) to create thumbnails for images
# If not set, it will be the same as image_tile_size

image_size =

# ======== Classification type ========
# OPTIONAL
# CPA 2.2.0 allows image classification instead of object classification.
# If left blank or set to "object", then Classifier will fetch objects (default).
# If set to "image", then Classifier will fetch whole images instead of objects.

classification_type  = 

# ======== Auto Load Training Set ========
# OPTIONAL
# You may enter the full path to a training set that you would like Classifier
# to automatically load when started.

training_set  =

# ======== Area Based Scoring ========
# OPTIONAL
# You may specify a column in your per-object table which will be summed and
# reported in place of object-counts when scoring.  The typical use for this
# is to report the areas of objects on a per-image or per-group basis.

area_scoring_column =

# ======== Output Per-Object Classes ========
# OPTIONAL
# Here you can specify a MySQL table in your Database where you would like
# Classifier to write out class information for each object in the
# object_table

class_table  = NPuntx_BrightfieldUntx

# ======== Check Tables ========
# OPTIONAL
# [yes/no]  You can ask classifier to check your tables for anomalies such
# as orphaned objects or missing column indices.  Default is on.
# This check is run when Classifier starts and may take up to a minute if
# your object_table is extremely large.

check_tables = yes

Hi @amurali,

Did you move the file ‘NPuntx.db’ after the CellProfiler run completed? The start of the .properties file needs to point to the correct location of this database.

1 Like

Hi,
In addition to what DStirling suggested, there should also be something in your plate_id and well_id:

Did you correctly extract your metadata in cp ?

1 Like

Thank you both! I did not realize I needed to extract metadata! I have added that to the pipeline. But I still am unable to view the file on CellProfiler Analyst. The properties file is in the same location (folder) as the database and nothing has been moved following generation from CellProfiler. Is there anything else I should change? Thank you so much for all your help!

Here is the updated properties file.

#Mon Jan 27 13:14:07 2020
# ==============================================
#
# CellProfiler Analyst 2.0 properties file
#
# ==============================================

# ==== Database Info ====
db_type         = sqlite
db_sqlite_file  = C:\Users\shobi\Desktop\CP_Output\NPuntx.db

# ==== Database Tables ====
image_table   = NPuntx_Per_Image
object_table  = NPuntx_Per_Object

# ==== Database Columns ====
# Specify the database column names that contain unique IDs for images and
# objects (and optionally tables).
#
# table_id (OPTIONAL): This field lets Classifier handle multiple tables if
#          you merge them into one and add a table_number column as a foreign
#          key to your per-image and per-object tables.
# image_id: must be a foreign key column between your per-image and per-object
#           tables
# object_id: the object key column from your per-object table

image_id      = ImageNumber
object_id     = ObjectNumber
plate_id      = Image_Metadata_Plate
well_id       = Image_Metadata_Well
series_id     = Image_Group_Number
group_id      = Image_Group_Number
timepoint_id  = Image_Group_Index

# Also specify the column names that contain X and Y coordinates for each
# object within an image.
cell_x_loc    = cells_grid_Location_Center_X
cell_y_loc    = cells_grid_Location_Center_Y

# ==== Image Path and File Name Columns ====
# Classifier needs to know where to find the images from your experiment.
# Specify the column names from your per-image table that contain the image
# paths and file names here.
#
# Individual image files are expected to be monochromatic and represent a single
# channel. However, any number of images may be combined by adding a new channel
# path and filename column to the per-image table of your database and then
# adding those column names here.
#
# Note that these lists must have equal length!
image_path_cols = Image_PathName_Brightfield,Image_PathName_TonEBP,Image_PathName_NFkB,Image_PathName_DRAQ,Image_PathName_Brightfield2
image_file_cols = Image_FileName_Brightfield,Image_FileName_TonEBP,Image_FileName_NFkB,Image_FileName_DRAQ,Image_FileName_Brightfield2

# CellProfiler Analyst will now read image thumbnails directly from the database, if chosen in ExportToDatabase.
image_thumbnail_cols = 

# Give short names for each of the channels (respectively)...
image_names = Brightfield,TonEBP,NFkB,DRAQ,Brightfield2

# Specify a default color for each of the channels (respectively)
# Valid colors are: [red, green, blue, magenta, cyan, yellow, gray, none]
image_channel_colors = 

# ==== Image Accesss Info ====
image_url_prepend = 

# ==== Dynamic Groups ====
# Here you can define groupings to choose from when classifier scores your experiment.  (e.g., per-well)
# This is OPTIONAL, you may leave "groups = ".
# FORMAT:
#   group_XXX  =  MySQL select statement that returns image-keys and group-keys.  This will be associated with the group name "XXX" from above.
# EXAMPLE GROUPS:
#   groups               =  Well, Gene, Well+Gene,
#   group_SQL_Well       =  SELECT Per_Image_Table.TableNumber, Per_Image_Table.ImageNumber, Per_Image_Table.well FROM Per_Image_Table
#   group_SQL_Gene       =  SELECT Per_Image_Table.TableNumber, Per_Image_Table.ImageNumber, Well_ID_Table.gene FROM Per_Image_Table, Well_ID_Table WHERE Per_Image_Table.well=Well_ID_Table.well
#   group_SQL_Well+Gene  =  SELECT Per_Image_Table.TableNumber, Per_Image_Table.ImageNumber, Well_ID_Table.well, Well_ID_Table.gene FROM Per_Image_Table, Well_ID_Table WHERE Per_Image_Table.well=Well_ID_Table.well

group_SQL_NPuntxcells = SELECT ImageNumber FROM NPuntx_Per_Image


# ==== Image Filters ====
# Here you can define image filters to let you select objects from a subset of your experiment when training the classifier.
# FORMAT:
#   filter_SQL_XXX  =  MySQL select statement that returns image keys you wish to filter out.  This will be associated with the filter name "XXX" from above.
# EXAMPLE FILTERS:
#   filters           =  EMPTY, CDKs,
#   filter_SQL_EMPTY  =  SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene="EMPTY"
#   filter_SQL_CDKs   =  SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene REGEXP 'CDK.*'



# ==== Meta data ====
# What are your objects called?
# FORMAT:
#   object_name  =  singular object name, plural object name,
object_name  =  cell, cells,

# What size plates were used?  96, 384 or 5600?  This is for use in the PlateViewer. Leave blank if none
plate_type  = 1536

# ==== Excluded Columns ====
# OPTIONAL
# Classifier uses columns in your per_object table to find rules. It will
# automatically ignore ID columns defined in table_id, image_id, and object_id
# as well as any columns that contain non-numeric data.
#
# Here you may list other columns in your per_object table that you wish the
# classifier to ignore when finding rules.
#
# You may also use regular expressions here to match more general column names.
#
# Example: classifier_ignore_columns = WellID, Meta_.*, .*_Position
#   This will ignore any column named "WellID", any columns that start with
#   "Meta_", and any columns that end in "_Position".
#
# A more restrictive example:
# classifier_ignore_columns = ImageNumber, ObjectNumber, .*Parent.*, .*Children.*, .*_Location_Center_.*,.*_Metadata_.*

classifier_ignore_columns  =  table_number_key_column, image_number_key_column, object_number_key_column

# ==== Other ====
# Specify the approximate diameter of your objects in pixels here.
image_tile_size   =  50

# Provides the image width and height. Used for per-image classification.
# If not set, it will be obtained from the Image_Width and Image_Height
# measurements in CellProfiler.

# image_width  = 1000
# image_height = 1000

# OPTIONAL
# Image Gallery can use a different tile size (in pixels) to create thumbnails for images
# If not set, it will be the same as image_tile_size

image_size =

# ======== Classification type ========
# OPTIONAL
# CPA 2.2.0 allows image classification instead of object classification.
# If left blank or set to "object", then Classifier will fetch objects (default).
# If set to "image", then Classifier will fetch whole images instead of objects.

classification_type  = 

# ======== Auto Load Training Set ========
# OPTIONAL
# You may enter the full path to a training set that you would like Classifier
# to automatically load when started.

training_set  =

# ======== Area Based Scoring ========
# OPTIONAL
# You may specify a column in your per-object table which will be summed and
# reported in place of object-counts when scoring.  The typical use for this
# is to report the areas of objects on a per-image or per-group basis.

area_scoring_column =

# ======== Output Per-Object Classes ========
# OPTIONAL
# Here you can specify a MySQL table in your Database where you would like
# Classifier to write out class information for each object in the
# object_table

class_table  = NPuntx_BrightfieldUntx

# ======== Check Tables ========
# OPTIONAL
# [yes/no]  You can ask classifier to check your tables for anomalies such
# as orphaned objects or missing column indices.  Default is on.
# This check is run when Classifier starts and may take up to a minute if
# your object_table is extremely large.

check_tables = yes

Do you get any error message, even briefly, when CellProfiler Analyst closes?

Unfortunately, no. The program just closes. The the tool bar of the program does appear briefly.

Okay, that does sound like a problem with the properties file but without seeing the source database it’s difficult to diagnose this further. Are you able to get Analyst to work properly with properties files from other experiments?

No, this is the first time I am using CellProfiler. I can send my CellProfiler project pipeline file if that would be helpful?

One of the questions I have is that I am using a 32x32 cell plate, and the directions on CellProfiler write that CellProfiler Analyst is only compatible with 96, 384, and 5600 plate arrays. Is that an issue? (Specifically the directions are: “If you are using a multi-well plate or microarray, you can select the plate type here. Supported types in CellProfiler Analyst are 96- and 384-well plates, as well as 5600-spot microarrays. If you are not using a plate or microarray, select None.”)

The pipeline file could be helpful. The program shouldn’t open without a functional properties file. An alternative might be a java environment issue, did you install all the prerequisites before installing Analyst?

One option might be to run through the translocation tutorial to create an example database and properties file. If you can load that then we can be sure your installation at least works.

To answer your question - That’s not an issue, just select “None” and CPA should be fine.

1 Like

I tried the translocation tutorial and was unable to open the properties file for this as well. I think you may be right that the issue is with the installation of the Program! Thank you for the tutorial.

For CellProfiler, I downloaded Java version 8. Was there more that I was supposed to download for CellProfiler Analyst?

Yes, you’ll also need the JDK for CellProfiler Analyst to work. Please see the instructions here.

1 Like

I have JDK downloaded as well, but I am still unable to open the properties file from the example. Is there something else I need to download, or do I need to “activate” the Java and JDK programs even after downloading and going through setup?

Okay, you might need to set up your environment properly. Could you open up a terminal and type java -version, then paste the result here? You might also want to do the same with echo$JAVA_HOME.

When I type both into my Command Prompt window I get this result.

C:\Users\shobi>java-version
‘java-version’ is not recognized as an internal or external command,
operable program or batch file.

C:\Users\shobi>echo$JAVA_HOME
‘echo$JAVA_HOME’ is not recognized as an internal or external command,
operable program or batch file.

Ah sorry, I didn’t realise this was on Windows! We have a guide here for troubleshooting Java on Windows. It should mostly apply to Analyst too.

Also, java -version needs the space, so that may be why it didn’t work.

No problem! Okay I tried again and I got this:

C:\Users\shobi>java -version
java version “1.8.0_241”
Java™ SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot™ 64-Bit Server VM (build 25.241-b07, mixed mode)

I’m still unable to get the properties file to run even after making all the changes suggested in the link. Do you know what else could be wrong?

C:\Users\shobi>SET CP_JAVA_HOME
CP_JAVA_HOME=C:\Program Files (x86)\CellProfiler\java

This was shown when I looked for the JAVA_HOME file. So everything with Java seems to be downloaded correctly. I restarted laptop and re-ran CellProfiler to generate the properties file and db file again. Still not able to open the properties file in CellProfiler Analyst.

I was wondering if I needed to download any database software beforehand or anything for the SQLite? Or is that not necessary for CellProfiler Analyst to run?

Also, I was reading that some users have Python software downloaded. Is this necessary?

There shouldn’t be any database software required, just Java and JDK. Python should be packaged with the download so that’s not necessary either.

Would you be able to upload your log file, which should be in C:\Program Files (x86)\CellProfiler-Analyst\CellProfiler-Analyst.exe.log if you’re using the default install directory? This might shed some further light on the situation.