Deleted:Violin Plot for Single-cell data, gene expression in different timepoints
Entering edit mode
4 weeks ago
keren.danan ▴ 10

Hello, I am trying to create a linear regression model for each gene, such that x axis is the time in hours the data was collected (single-cell data) and the y axis is the expression of gene - in log2pm. The problem is that creating violin plot suggests that the X scale is dicrete, so each object is "close" to each other object as the same distance as to others while the time differences are not equal. Here is an example: enter image description here

Here is what I tried to do to extend the x limits but with no success.

enter image description here

Any idea?

Here is my code:

p <- ggplot(interesting_gene, aes(x = factor(Stage), y = CALM1A, color = factor(Stage))) +
  geom_violin(scale = "width") +
  geom_abline(slope=fit_lm$coefficients[2], intercept=fit_lm$coefficients[1], lwd=.8, color='black')+
  geom_abline(slope=fit_lm1$coefficients[2], intercept=fit_lm1$coefficients[1], lwd=.8, color='blue')+
  theme_bw() +
  theme(legend.position = 'none')+
  xlab("Developmental Stage in hours")+
  scale_x_discrete(limits = c(0.3:12.3))+
  ylab("Expression in log2TPM")


The time points are: 3.3,3.8,4.3,4.8,5.3,6,7...,12

violin-plot gene-expression R single-cell • 95 views
This thread is not open. No new answers may be added
Traffic: 1187 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6