Commit 30dd3652 authored by Bagueneau Mathias's avatar Bagueneau Mathias
Browse files

améliorations

parent e05f2f52
......@@ -293,9 +293,9 @@ server <- function(input, output, session) {
withProgress(DimPlot(object = filedata$data, label=TRUE, pt.size = input$ptsize_compare, legend="none", reduction=input$graph_compare, group.by = input$fsel2), message = "Plot Generation", value=1) + theme_bw() + NoAxes() + NoLegend()
} else {
if (input$featuresel2 =="d2") {
withProgress(FeaturePlot(object = filedata$data, legend="none", cols=c("lightgrey",plasma(ceiling(max(eval(parse(text=paste0("filedata$data@meta.data$",input$nsel2))))))), pt.size = input$ptsize_compare, features = input$nsel2, reduction = input$graph_compare), message = "Plot Generation", value=1) + theme_bw()+ NoAxes()
withProgress(FeaturePlot(object = filedata$data, cols=c("lightgrey",plasma(ceiling(max(eval(parse(text=paste0("filedata$data@meta.data$",input$nsel2))))))), pt.size = input$ptsize_compare, features = input$nsel2, reduction = input$graph_compare), message = "Plot Generation", value=1) + theme_bw()+ NoAxes()
} else if (input$featuresel2 =="g2") {
withProgress(FeaturePlot(object = filedata$data, legend="none", cols=c("lightgrey",plasma(ceiling(max(filedata$data@assays$SCT@data[input$genes2,])))), pt.size = input$ptsize_compare, features = input$genes2, reduction = input$graph_compare), message = "Plot Generation", value=1) + theme_bw()+ NoAxes()
withProgress(FeaturePlot(object = filedata$data, cols=c("lightgrey",plasma(ceiling(max(filedata$data@assays$SCT@data[input$genes2,])))), pt.size = input$ptsize_compare, features = input$genes2, reduction = input$graph_compare), message = "Plot Generation", value=1) + theme_bw()+ NoAxes()
}
}
})
......@@ -347,7 +347,7 @@ server <- function(input, output, session) {
output$markers_table <- renderDataTable ({
req(filedata$data)
req(markersData() != "")
datatable(markersData()[c(6,3,4,2,1,5)]) %>% formatRound(columns=c(2,3,4), digits=5) %>% formatSignif(columns=c(6,5), digits=5)
datatable(markersData()[c(6,3,4,2,1,5)], caption = paste("Table 1 : All significant markers for the factor :", input$fsel ,"| Test used : MAST" )) %>% formatRound(columns=c(2,3,4), digits=5) %>% formatSignif(columns=c(6,5), digits=5)
})
output$miniplot_compare <- renderPlot({
......@@ -371,11 +371,10 @@ server <- function(input, output, session) {
})
heatmapData <- reactive ({
req(input$goheatmap)
t <- paste0("Resolution.",str_extract(input$fsel3,"(\\d.*)"))
if (is.null(filedata$data@misc$markers[[t]])) {
if (is.null(filedata$data@misc$markers[[input$fsel3]])) {
showModal(modalDialog("The markers may have not been calculated for this factor yet.", title=strong("Warning !"), easyClose=TRUE, footer = NULL ))
} else {
topgenes <- filedata$data@misc$markers[[t]] %>% group_by(cluster) %>% top_n(n = input$top_number, wt = avg_logFC)
topgenes <- filedata$data@misc$markers[[input$fsel3]] %>% group_by(cluster) %>% top_n(n = input$top_number, wt = avg_logFC)
datascale <- withProgress(ScaleData(object = filedata$data, features = topgenes$gene), message = "Scaling data...", value=1)
withProgress(DoHeatmap(object = datascale, features = topgenes$gene, group.by=input$fsel3), message = "HeatMap Generation", value=1) + NoLegend() + ggtitle(paste(filedata$name,"- HeatMap -", input$fsel3,"- top",input$top_number,"genes"))
}
......@@ -388,9 +387,8 @@ server <- function(input, output, session) {
## Genes Page --------
goplotData <- reactive ({
req(input$gogo)
pat <- "(\\d.*)" # Pattern of the number
genes <- filedata$data@misc$markers[[paste0("Resolution.", str_extract(input$fsel4, pat)) ]]$cluster == input$group_genepage
genes <- filedata$data@misc$markers[[paste0("Resolution.", str_extract(input$fsel4, pat)) ]]$gene[genes]
genes <- filedata$data@misc$markers[[input$fsel4]]$cluster == input$group_genepage
genes <- filedata$data@misc$markers[[input$fsel4]]$gene[genes]
genes <- bitr(genes, fromType = "SYMBOL",
toType = "ENTREZID",
OrgDb = org.Hs.eg.db,
......@@ -622,11 +620,11 @@ server <- function(input, output, session) {
## Help messages --------
observeEvent (input$help1, {
showModal(modalDialog("In this page, you first need to upload a *.rds file. Then it gives you two visualizations of your file. The first one shows you the clusters, and the second the repartition of a selected gene. You also have access to all of the markers in the table under the two graphs. You could choose a resolution, a gene, the graph mode (T-sne or Umap). You could also filter by library (if there is more than one in your file), and have information about the clusters. On the graphs, you can zoom, change the point size, and select a portion of cells with two differents tools (box or lasso). Information about your selection will appears into the text box. The two graphs and the markers table could be downloaded with the three buttons at the end of the Control Panel.", title=strong("Vizualisation page Help"), easyClose=TRUE, footer = NULL )
showModal(modalDialog("Hello World !", title=strong("Vizualisation page Help"), easyClose=TRUE, footer = NULL )
)
})
observeEvent (input$help2, {
showModal(modalDialog("This page gives you a ViolinPlot of the selected gene in the different clusters. You also have some information about the gene selected in the textbox on the right. Here you could choose a gene and a resolution. You could also choose other options like Y-axis, ... You could download the ViolinPlot with the button at the end of the Control Panel.", title=strong("Genes page Help"), easyClose=TRUE, footer = NULL )
showModal(modalDialog("Hello world !", title=strong("Genes page Help"), easyClose=TRUE, footer = NULL )
)
})
observeEvent (input$help3, {
......@@ -663,7 +661,7 @@ server <- function(input, output, session) {
names(df)[[7]] <- paste("",input$fsel2)
output$markers_compare <- renderDataTable ({
req(filedata$data)
withProgress(datatable(df[c(1,4,5,3,2,6)], rownames=FALSE), message = "Render DataTable", value=1) %>% formatRound(columns=c(1,2,3,4), digits=5) %>% formatSignif(columns=c(6,5), digits=5)
withProgress(datatable(df[c(1,4,5,3,2,6)], rownames=FALSE, caption = "Table 2 : Significant markers of your query | Test used : MAST" ), message = "Render DataTable", value=1) %>% formatRound(columns=c(1,2,3,4), digits=5) %>% formatSignif(columns=c(6,5), digits=5)
})
output$dlmarkbutton_compare <- renderUI ({
downloadButton("dlmarkers_compare", label="")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment