Commit c1798a56 authored by Bagueneau Mathias's avatar Bagueneau Mathias
Browse files

-Bug fix test

parent 783803a7
......@@ -20,12 +20,6 @@ library(org.Hs.eg.db)
library(tools)
library(PANTHER.db)
# library(topGO)
# library(BiocGenerics)
# library(GO.db)
# library(DOSE)
### ----------------------------- User interface -----------------------------------------------------
......@@ -236,9 +230,9 @@ body <- dashboardBody(
p("IRS-UN"),
p("8 Quai Moncousu"),
p("44007 Nantes"), br(),
img(src = "crcina.png", height = 180, width = 400),
img(src = "crcina.png", height = 180, width = 400, align="center"),
br(), hr(), br(), p(em("Development Team : Jean-Baptiste ALBERGE, Jonathan CRUARD, Mathias BAGUENEAU"), br(), em("Beta-test : Benjamin DELAUNE")),
br(), p(strong("Git repository :"),a(href="https://gitlab.univ-nantes.fr/MathBgn/myelome", "Shiny SChnurR"), br(), em("A complete tutorial is findable in this."))
br(), p(strong("Git repository :"),a(href="https://gitlab.univ-nantes.fr/MathBgn/myelome", "Shiny SChnurR"), br(), em("A complete tutorial is available at this adress."))
)
)
)
......@@ -286,16 +280,16 @@ server <- function(input, output, session) {
selectInput(inputId="file", label="Or choose a file :", choices = c("",list.files(path = "./data",full.names = FALSE,recursive = FALSE)))
})
## Creating a usefull object for filedata (readable & writable) and assay gestion --------
wrfile <- reactive ({
wrdata <- filedata$data
if (!is.null(wrdata@assays$SCT)) {
DefaultAssay(wrdata) <- "SCT"
} else {
DefaultAssay(wrdata) <- "RNA"
}
return (wrdata)
})
# ## Creating a usefull object for filedata (readable & writable) and assay gestion --------
# wrfile <- reactive ({
# wrdata <- filedata$data
# if (!is.null(wrdata@assays$SCT)) {
# DefaultAssay(wrdata) <- "SCT"
# } else {
# DefaultAssay(wrdata) <- "RNA"
# }
# return (wrdata)
# })
## Graphs & one table Generations --------
......@@ -521,11 +515,11 @@ server <- function(input, output, session) {
})
## Downloads functions --------
output$dlmarkbutton_visu <- renderUI ({ # Visualisation Page
output$dlmarkbutton_visu <- renderUI ({ # visualization Page
req(markersData() != "")
downloadButton("dlmarkers", label="")
})
output$dlmarkers <- downloadHandler( # Visualisation Page
output$dlmarkers <- downloadHandler( # visualization Page
filename = function() {
paste0(file_path_sans_ext(filedata$name),"_allmarkers_",input$fchoice,".csv")
},
......@@ -534,7 +528,7 @@ server <- function(input, output, session) {
}
)
output$dlleftplot <- downloadHandler( # Visualisation Page
output$dlleftplot <- downloadHandler( # visualization Page
filename = function() {
paste0(file_path_sans_ext(filedata$name),"_plot_",input$fsel,"_",input$graph,".svg")
},
......@@ -545,7 +539,7 @@ server <- function(input, output, session) {
}
)
output$dlrightplot <- downloadHandler( # Visualisation Page
output$dlrightplot <- downloadHandler( # visualization Page
filename = function() {
if (input$featuresel =="g") {
paste0(file_path_sans_ext(filedata$name),"_",input$genes,"_plot_",input$graph,".svg")
......@@ -843,7 +837,7 @@ server <- function(input, output, session) {
showModal(modalDialog("You first need to upload a .rds file, or choose one already provided as example.
Then, many information are provided :
Some files information, with genes and cells number, and the assay used.
Two graphs for the visualisation.
Two graphs for the visualization.
A data table with some pre-calculated markers.
The first graph allows you to visualise by all the factors (resolution, idents, ...) of your file.
The second one is for the features or data (all the genes repartitions, scores, ...).
......@@ -860,23 +854,28 @@ You have to choose a factor, group(s) of it, and ontology. Three type of ontolog
Then you will have a graph (you can also change the graph mode), and two tables.
The first table gives you the list of the genes present in your selection.
The second one gives you the ontology.
The Gene Ontology also use the pre-calculated markers for each factors (like the data table from the visualisation page and the HeatMap).
The Gene Ontology also use the pre-calculated markers for each factors (like the data table from the visualization page and the HeatMap).
All of the outputs are exportable : in .png for the graph and in .csv for the tables.", title=strong("Genes page Help"), easyClose=TRUE, footer = NULL )
)
})
observeEvent (input$help3, {
showModal(modalDialog("In this page, you could compare groups from factors with each other.
You could choose multiple groups, and also add a second factor to filter with.
Then you could Find the significant markers of your selection, or also do a Gene Ontology like in the Genes page (but here, the markers are calculated before the ontology).
Then you could Find the significant markers of your selection.
Be carefull to not select redondant cells.
Like the Visualisation page, you have a Control panel to change some parameters to the graphs (like graph mode, point size, ...) and choose what you want to see (factors, features, ...).
All of the outputs are exportable : in .svg for the graphs and in .csv for the table.", title=strong("Compare page Help"), easyClose=TRUE, footer = NULL )
After this, another option and two text areas appears. The text areas are filled with the top 30 genes upregulated from one condition against the other. These areas are writable (you can add or remove some genes).
Then you could do a gene ontology with these two lists.
The results are into two tables.
Like the Visualization page, you have a Control panel to change some parameters to the graphs (like graph mode, point size, ...) and choose what you want to see (factors, features, ...).
You could also choose an ontology.
All of the outputs are exportable : in .svg for the graphs and in .csv for the tables.
You could also export the barcodes of the selected cells, in .csv.", title=strong("Compare page Help"), easyClose=TRUE, footer = NULL )
)
})
observeEvent (input$help4, {
showModal(modalDialog("The HeatMap page allows you to do a HeatMap with many parameters.
You could choose a factor and the number of top genes you want to be shown.
The HeatMap also use the pre-calculated markers for each factors (like the data table from the visualisation page).
The HeatMap also use the pre-calculated markers for each factors (like the data table from the visualization page).
The HeatMap is exportable in .png.", title=strong("HeatMap page Help"), easyClose=TRUE, footer = NULL )
)
})
......@@ -984,14 +983,12 @@ The HeatMap is exportable in .png.", title=strong("HeatMap page Help"), easyClos
if (is.null(input$top1) || is.null(input$top2)) {
showModal(modalDialog("At least one of the text area is empty !", title=strong("Warning !"), easyClose=TRUE, footer = NULL ))
} else if (input$add %% 2 != 0) {
showModal(modalDialog("At least one of the select is empty !", title=strong("Warning !"), easyClose=TRUE, footer = NULL ))
} else {
} else {
leftchain <- strsplit(input$top1, "\n")
genesc <- bitr(leftchain[[1]], fromType = "SYMBOL",toType = "ENTREZID",OrgDb = org.Hs.eg.db,drop = TRUE)
egoc <- withProgress(enrichGO(gene = genesc$ENTREZID, OrgDb = "org.Hs.eg.db", keyType= "ENTREZID", ont = input$ontology2, readable = TRUE), value = 1, message = "Ontology n°1 in progress...")
dfo <- data.table(egoc@result$Description, egoc@result$GeneRatio, egoc@result$pvalue, egoc@result$p.adjust)[which(egoc@result$Count > 2)]
colnames(dfo) <- c("Description","Gene Ratio","P-value","FDR","geneID")
dfo <- data.table(egoc@result$Description, egoc@result$GeneRatio, egoc@result$pvalue, egoc@result$p.adjust, egoc@result$geneID)[which(egoc@result$Count > 2)]
colnames(dfo) <- c("Description","Gene Ratio","P-value","FDR","GeneID")
output$onto_compare1 <- renderDataTable ({
req(wrfile())
withProgress(datatable(dfo, filter="top", caption = paste("Table : Gene Ontology (",input$ontology2,") for the left selected group(s) and this factor : ", input$fsel2,"| Only takes groups with a ratio > 2/Total, p-value cutoff : 0.05")), value=1, message = "Rendering Datatable...") %>% formatSignif(columns=c(3,4), digits=3)
......@@ -1016,14 +1013,12 @@ The HeatMap is exportable in .png.", title=strong("HeatMap page Help"), easyClos
if (is.null(input$top1) || is.null(input$top2)) {
showModal(modalDialog("At least one of the text area is empty !", title=strong("Warning !"), easyClose=TRUE, footer = NULL ))
} else if (input$add %% 2 != 0) {
showModal(modalDialog("At least one of the select is empty !", title=strong("Warning !"), easyClose=TRUE, footer = NULL ))
} else {
} else {
rightchain <- strsplit(input$top2, "\n")
genesc <- bitr(rightchain[[1]], fromType = "SYMBOL",toType = "ENTREZID",OrgDb = org.Hs.eg.db,drop = TRUE)
egoc <- withProgress(enrichGO(gene = genesc$ENTREZID, OrgDb = "org.Hs.eg.db", keyType= "ENTREZID", ont = input$ontology2, readable = TRUE), value = 1, message = "Ontology n°1 in progress...")
dfo <- data.table(egoc@result$Description, egoc@result$GeneRatio, egoc@result$pvalue, egoc@result$p.adjust)[which(egoc@result$Count > 2)]
colnames(dfo) <- c("Description","Gene Ratio","P-value","FDR","geneID")
dfo <- data.table(egoc@result$Description, egoc@result$GeneRatio, egoc@result$pvalue, egoc@result$p.adjust, egoc@result$geneID)[which(egoc@result$Count > 2)]
colnames(dfo) <- c("Description","Gene Ratio","P-value","FDR","GeneID")
output$onto_compare2 <- renderDataTable ({
req(wrfile())
withProgress(datatable(dfo, filter="top", caption = paste("Table : Gene Ontology (",input$ontology2,") for the right selected group(s) and this factor : ", input$fsel2,"| Only takes groups with a ratio > 2/Total, p-value cutoff : 0.05")), value=1, message = "Rendering Datatable...") %>% formatSignif(columns=c(3,4), digits=3)
......
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