labsyspharm / quantification

Quantification module for mcmicro
https://github.com/labsyspharm/mcmicro
9 stars 13 forks source link

Check for a mismatch against markers.csv #32

Closed ArtemSokolov closed 2 years ago

ArtemSokolov commented 3 years ago

The module throws a verbose, unintuitive error (in the form of a regionprops call stack) when the number of channels in the image mismatches the number of entries in markers.csv.

Add a check for consistency against markers.csv early in the process (e.g., immediately upon file loading). Throw an informative error message if there is a mismatch.

ArtemSokolov commented 2 years ago

Loading should also correctly handle single-column .csv files with a marker_name header. Currently,

marker_name
Hoechst
CD45
CD3
CD4

is interpreted as having five markers, because Line 215 in https://github.com/labsyspharm/quantification/blob/53beec0a1140d0fc85d5f354d8552bc52331542b/SingleCellDataExtraction.py#L207-L218 always assumes that single-column files don't contain a header.

DenisSch commented 2 years ago

@ArtemSokolov Is marker_name the output from reagent tracker or will this change again?

ArtemSokolov commented 2 years ago

@DenisSch I actually don't know where marker_name is coming from, but every markers.csv file I've seen uses it.