Skip to content

Commit

Permalink
plotGenes improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
noriakis committed Apr 26, 2024
1 parent 906c741 commit 9542821
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions R/plotGenes.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,22 @@ plotGenes <- function(stana, species, geneID, target="genes", cl=NULL, return_df
}
geneDf$geneID <- row.names(geneDf)
df <- geneDf |> tidyr::pivot_longer(1:ncol(geneDf)-1)
df$group <- listToNV(stana@cl)[df$name]
df$group <- listToNV(cl)[df$name]

if (return_df){
return(df)
}

if (length(cl)==length(stana@colors)) {
cols <- stana@colors
} else {
cols <- RColorBrewer::brewer.pal(length(cl), "RdBu")
}
print(cols)
ggplot(df, aes(x=group, y=value,
fill=group)) +
geom+
geom_jitter(shape=21, size=2)+
scale_fill_manual(values=stana@colors)+
scale_fill_manual(values=cols)+
facet_wrap(.~geneID)+
cowplot::theme_cowplot()+
cowplot::panel_border()
Expand Down

0 comments on commit 9542821

Please sign in to comment.