Skip to content

Commit

Permalink
subplots
Browse files Browse the repository at this point in the history
  • Loading branch information
emarshall124 committed Oct 16, 2016
1 parent e738aac commit 6dc1406
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions ClusterPlots.R
Expand Up @@ -3,6 +3,7 @@
install.packages("reshape")
library(reshape)


#NEED TO
# - create dataframe df with 2 columns: y and Group
# - search matrix for row (gene) and look for cells corresponding to clusters of interest
Expand All @@ -17,22 +18,14 @@ df2 = expression[selectedgenes, id2]
df2 <- as.matrix(df2)
df2 <- t(df2)
df2 <- melt(df2, id=c("geneid", "value"))
ggplot(df2,aes(factor(df2$X2),df2$value))+geom_violin()

selectedgenes = c("ENSG00000171798", "ENSG00000151651", "ENSG00000161328", "ENSG00000180066")
df3 = expression[selectedgenes, id3]
df3 <- as.matrix(df3)
df3 <- t(df3)
df3 <- melt(df3, id=c("geneid", "value"))
ggplot(df3,aes(factor(df3$X2),df3$value))+geom_violin()

dfnew = (df[1,])
#df[1,] = expression["ENSG00000171798", id2] #only takes row if the row is equal to the input gene (MAX input 4 genes)
#df[2,] = expression["ENSG00000151651", id2]
#df[3,] = expression["ENSG00000161328", id2]
#df[4,] = expression["ENSG00000180066", id2]

#dfnew<-data.frame[]
#dfnew<-dfnew(df[,"group"] == GROUPSELECTED) #only pulls columns of cell type of interest
#names(dfnew)<-("y", "group")
plot2 <- ggplot(df2,aes(factor(df2$X2),df2$value))+geom_violin()
plot3 <- ggplot(df3,aes(factor(df3$X2),df3$value))+geom_violin()
subplot(plot2, plot3)

0 comments on commit 6dc1406

Please sign in to comment.