ktrns / scrnaseq

Workflow for single-cell RNA-seq analysis using Seurat
MIT License
37 stars 15 forks source link

Error in GenerateColours #107

Open semenko opened 2 years ago

semenko commented 2 years ago

When processing 11 samples, I get this error:

image

Error in GenerateColours(num_colours = length(sample_names), names = sample_names,  : 
  GenerateColours: Cannot generate the requested number of colours. Please change palette or add alpha values.

Called on this line: https://github.com/ktrns/scrnaseq/blob/0376bc233d64667cad46d33c2149a6440b1d4909/scrnaseq.Rmd#L539

I've temporarily worked around this by setting alphas=c(1,0.2).

semenko commented 2 years ago

Note this error also throws in the output section here: https://github.com/ktrns/scrnaseq/blob/0376bc233d64667cad46d33c2149a6440b1d4909/scrnaseq.Rmd#L2823

andpet0101 commented 2 years ago

Hi,

sorry for the delay in answering.

The palette ggsci::pal_jama has only 7 different colours so that with 11 samples you would need to use another palette.

You can also use other alpha values as you did in your workaround. In fact, originally, we did the same to extend the palettes. However, we then found that the single cell browser cellxgene does not support transparent colours/different alpha values (at least at this time, so that we decided that using another palette would be the best option.

I can check again regarding cellxgene if now different alpha values may be an option. We could also implement that in such a case a bigger palette is automatically used.

Best,

Andreas

semenko commented 2 years ago

Thank you!

Most issues I've run into are similar -- I have >10 samples (>50,000 cells, etc.) and am trying to analyze the full dataset (not-downsampled). I end up with 15+ UMAP clusters, and have ~15 custom cell types defined -- which works great, but causes lots of small issues like the above, usually with graph / plot sizing.

ktrns commented 2 years ago

Dear @semenko

Thanks a lot for getting back to us. Please feel free to post any issues you are getting related to high cell numbers. Our datasets are usually a bit smaller, which is why we aren't aware of the issues that come up.

I am happy to improve all those small issues like graph and plot sizing, just let me know.

Best wishes Katrin

ktrns commented 2 years ago

@andpet0101 will check out if cellxgene now allows transparent colours. If it doesn't we need to find a bigger colour palette.