angelolab / ark-analysis

Integrated pipeline for multiplexed image analysis
https://ark-analysis.readthedocs.io/en/latest/
MIT License
70 stars 25 forks source link

Mass Plotting needs a few adjustments #1064

Closed srivarra closed 11 months ago

srivarra commented 11 months ago

Is your feature request related to a problem? Please describe.

There are a few minor issues in the mass plotting notebook.

  1. The mass plotting functionality needs the dpi and the figsize parameter for cohort_cluster_plot and color_segmentation_by_stat functions.

  2. There is also an issue where the user provided colormap file is mis-coloring the cluster names provided (i.e. the ordering / mapping is incorrect)

  3. In addition, the interpolation should be set to "none" for plot_utils.color_segmentation_by_stat.

  4. Incorrect colors are not reported to the user in plot_utils.cohort_cluster_plot.

  5. Add option to save the plot w or w/o colorbar as a png or a pdf.

Describe the solution you'd like

Add the two parameters, look into the mis-coloring issue for color maps, set the interpolation to "none", and report incorrect colors.

Describe alternatives you've considered

N/A

Additional context

N/A

ngreenwald commented 11 months ago

Another adjustment: when we import into illustrator, having an SVG of the colorbar is helpful for manipulating. Could you add the option to specify the extension (either .png or .pdf) of the cluster plots images?

ngreenwald commented 11 months ago

If the supplied colormap has different elements than the cell table, the error message isn't very informative. We should probably add a verify_in_list or equivalent before constructing the colormap:

image