jn-goe / gruffi

Granular Functional Filtering (Gruffi) to isolate stressed cells
GNU General Public License v3.0
11 stars 6 forks source link

Error in scBarplot.CellFractions: custom_col_palette is wrongly handled. #23

Open vertesy opened 3 weeks ago

vertesy commented 3 weeks ago

Describe the bug Plot fails on color palette error

To Reproduce Use a group.by with >12 categories

Expected behavior auto switch to another paletter

>   StressBarplotPerCluster(combined.obj, group.by = GetClusteringRuns(combined.obj)[2])
Clustering runs found:
c("RNA_snn_res.0.1", "RNA_snn_res.0.2", "RNA_snn_res.0.3", "RNA_snn_res.0.4", 
"RNA_snn_res.0.6", "RNA_snn_res.100")

     FALSE  TRUE
  0  31939   381
  1  22288   180
  10   192   240
  11   300   130
  12   172     0
  2  22084     1
  3  11093  1307
  4  11092   812
  5   8919     2
  6   7471    16
  7   1552  2525
  8   1762  2184
  9   2446   144
2 Y-categories present: FALSE, TRUE
Error in scBarplot.CellFractions(obj = obj, fill.by = fill.by, group.by = group.by,  : 
  Length(custom_col_palette) should be >= nr. categories displayed.
vertesy commented 3 weeks ago

StressBarplotPerCluster(combined.obj, group.by = 'R44.annotation_fine', custom_col_palette = F) works but colors are opposite to (green = stressed)