Deleted:Violin Plot for Single-cell data, gene expression in different timepoints
0
1
Entering edit mode
3.1 years ago
keren.danan ▴ 20

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")+
  labs(title=plot_title)+
  scale_x_discrete(limits = c(0.3:12.3))+
  ylim(0,8)+
  ylab("Expression in log2TPM")

p

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

violin-plot gene-expression R single-cell • 513 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1449 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