How to customize the color in 'plot_cell_trajectory' function
1
0
Entering edit mode
@initialqy-23722
Last seen 15 months ago

Hi, I'm sorry I have a question. I try to color the Module score in the "plotcelltrajectory", here is the codes: data <- AddModuleScore( object =data, features = angio_Features, ctrl = 5, name = 'angio_score', seed = 1 ) #add angio score on each sample

Then I create the monocle object "monocledata", Now I use plotcell_trajectory to check the angio score through pseudotime, the color bar is dark blue to light blue. I want to change the colour.

coul <- colorRampPalette(brewer.pal(8, "RdYlBu"))(25)
plot_cell_trajectory(
  monocle_data, color_by = "angio_score1") + scale_color_manual(breaks = waiver(),values=coul)

Here is the error Error: Continuous value supplied to discrete scale

How can I do this? Thank you.

scRNA seq monocle • 393 views
ADD COMMENT
0
Entering edit mode
@kevin
Last seen 3 hours ago
Republic of Ireland

This is more an issue with ggplot2::scale_color_manual more than monocle. What is the waiver() function doing here? Can you please search for the error message ('Error: Continuous value supplied to discrete scale') in order to see how you can fix this problem? - it is a commonly-reported error, but not related to monocle. Coincidentally, there is an example usage of plot_cell_trajectory(..) + scale_color_manual(..) in this Rmd file: Single-cell RNA-seq revealed a concomitant delay in differentiation and cell cycle of aged hematopoietic stem cell

Kevin

ADD COMMENT

Login before adding your answer.

Traffic: 207 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6