Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
N
ngs_tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
bioinfo
ngs_tools
Commits
94e88239
Commit
94e88239
authored
Mar 22, 2019
by
Lena Hersemann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added violin plot to visualize gene expression of the individual clusters; cosmetics
parent
b9755a53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
sc_workflow/sc_apps/clustering_explorer
sc_workflow/sc_apps/clustering_explorer
+27
-4
No files found.
sc_workflow/sc_apps/clustering_explorer
View file @
94e88239
...
...
@@ -152,6 +152,7 @@ app <- shinyApp(
tabPanel("TSNE",
radioButtons("vis_method", label = "", choiceNames = c("expression", "cluster"), choiceValues = c("expression", "cluster"), inline = TRUE, selected = "expression"),
plotOutput(outputId = "tsne", height = "auto")),
tabPanel("Violin plot", plotOutput(outputId = "violin", height = "auto")),
tabPanel("Heatmap", plotOutput(outputId = "heatmap", height = 800))
)
)
...
...
@@ -307,6 +308,27 @@ app <- shinyApp(
plotting_violin <- function(data) {
plot_rows <- if (length(selected_samples()) > 1) { floor(length( selected_samples() )/2) } else { as.numeric(1) }
lapply(append(selected_samples(), "legend"), function(x){
data %>%
filter(str_detect(cluster_name, x)) %>%
ggplot(aes(as.factor(cluster_num), score, fill = as.factor(cluster_num))) +
geom_violin() +
theme(legend.position="none") +
xlab("") +
ggtitle(paste(x))
}) %>% grid.arrange(grobs = ., nrow = plot_rows)
}
output
$violin
<- renderPlot({ plotting_violin(outHeatmapData()) },
height = function(){400* if (length(selected_samples()) > 1) { floor(length( selected_samples() )/2) } else { as.numeric(1.5) }})
plotting_tsne <- function(data, vis_mode){
plot_rows <- if (length(selected_samples()) > 1) { floor(length( selected_samples() )/2) } else { as.numeric(1) }
...
...
@@ -319,7 +341,8 @@ app <- shinyApp(
geom_point(size = 0.2) +
guides(colour = guide_legend(override.aes = list(size=5), title="cluster")) +
coord_fixed() +
ggtitle(x)
ggtitle(x) #+
#geom_encircle(aes(x = tSNE_1, y = tSNE_2), subset_data, expand = 0.01)
}else if (vis_mode == "expression"){
data[ which(data
$cluster_name
== x),] %>%
...
...
@@ -335,9 +358,9 @@ app <- shinyApp(
}
output
$tsne
<- renderPlot({
p
h <-
plot_to_draw <- plotting_tsne(outHeatmapData(), input
$vis_method
)
plot_to_draw
p
lotting_tsne(outHeatmapData(), input
$vis_method
)
#
plot_to_draw <- plotting_tsne(outHeatmapData(), input
$vis_method
)
#
plot_to_draw
}, height = function(){400* if (length(selected_samples()) > 1) { floor(length( selected_samples() )/2) } else { as.numeric(1.5) }})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment