How to remove small, horizontal lines from my violin plot of normalized expression data with scRNA-seq data?

29 Views Asked by At

I am new to bioinformatics and scRNA-seq. I am trying to make a violin plot of the normalized expression values of a single gene within each Seurat cluster grouped within two sample groups.

Groups: Pre-HIV and Post-HIV Seurat clusters: 0-4

Here is what I have so far: Violin Plot

I would like to remove the small horizontal bars that I believe correspond to the individual expression values. Any ideas on how to do this?

Here is my code:

data.df <- [email protected][, c("seurat_clusters", "group_main")]
data.df["value"] <- sc.long.hiv$SCT@data["IFNG", ]
data.df <- data.df %>% mutate(group = paste(seurat_clusters, group_main, sep=":"))

data.df.2 <- data.df %>% group_by(group)
X <- str_split(data.df.2$'group', ":", 2, simplify=TRUE)
data.df.2$'seurat_clusters' <- X[, 1]
data.df.2$'group_main' <- X[, 2]

p <- data.df.2 %>% ggplot(aes(fill=group_main, y=value, x=seurat_clusters, color=group_main)) + 
  scale_color_manual(values = c("#17606D", "#AA1628"))+
    geom_violin( position="dodge", stat = "ydensity", width=1) +
  scale_fill_manual(values = c("#17606D", "#AA1628")) + 
  theme_classic() +
    geom_errorbar(
        aes(ymin=value, ymax=value), width=.2,
        position=position_dodge(.9)) +
  xlab('Cluster') +
  ylab('Normalized Gene Expression')
0

There are 0 best solutions below