Commit 1415bbfd authored by Bagueneau Mathias's avatar Bagueneau Mathias
Browse files

- Ajouts Siric + Héma

parent 9a2f10a7
......@@ -214,7 +214,7 @@ body <- dashboardBody(
uiOutput(align="left","ontobutton"),
fluidRow(column(align="center",width=6, column(align="center", width=2, uiOutput("topgenes1"),br(), uiOutput(align="center","dlontobutton_compare1") ) , column(align="center", width=10, br(), dataTableOutput("onto_compare1"))),
column(align="center",width=6, column(align="center", width=10, br(), dataTableOutput("onto_compare2")), column(align="align", width=2, uiOutput("topgenes2"),br(), uiOutput(align="align","dlontobutton_compare2") )))
)
)
),
# Pipeline Item --------
tabItem(tabName="pipeline_item", align="center",
......@@ -231,7 +231,10 @@ body <- dashboardBody(
p("IRS-UN"),
p("8 Quai Moncousu"),
p("44007 Nantes"), br(),
img(src = "crcina.png", height = 180, width = 400, align="center"),
img(src = "crcina.png", height = 180, width = 400, align="center"), br(),
fluidPage(
column(width=6, img(src = "hema.png", height = 100, width = 300, align="center")),
column(width=6, img(src = "siric.jpg", height = 180, width = 180, 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 available at this adress."))
)
......@@ -305,8 +308,8 @@ server <- function(input, output, session) {
# List group <-> color for every factor
alldf <- reactive ({
coldf <- lapply(wrfile()@meta.data[,sapply(wrfile()@meta.data, class) %in% c("factor","character")], assign.colors, obj=wrfile(), palette="Dark2")
return(coldf)
coldf <- lapply(wrfile()@meta.data[,sapply(wrfile()@meta.data, class) %in% c("factor","character")], assign.colors, obj=wrfile(), palette="Dark2")
return(coldf)
})
## Graphs & one table Generations --------
......@@ -350,7 +353,7 @@ server <- function(input, output, session) {
} else {
selectedCells <- SubsetData(object = wrfile(), cells=rownames(wrfile()@meta.data)[which(eval(parse(text=paste0("wrfile()@meta.data$",input$fsel2))) %in% input$library1_compare)] )
}
return(selectedCells)
return(selectedCells)
})
plot1_compareData <- reactive ({ # Left Graph Compare page
......@@ -485,7 +488,7 @@ server <- function(input, output, session) {
}
}
})
output$goplot <-renderPlot ({
req(wrfile())
goplotData()
......@@ -505,7 +508,7 @@ server <- function(input, output, session) {
req(!is.null(input$group_genepage))
datatable(dtgoData(), filter="top", caption = paste("Table : Markers for the following group(s) : ",paste(sapply(input$group_genepage, paste, collapse=""), collapse=" + "), "and this factor : ", input$fsel4))
})
dtontoData <- reactive ({ # Ontology Table
filegene <- wrfile()
......@@ -589,14 +592,14 @@ server <- function(input, output, session) {
})
output$dl_godt <- downloadHandler(
filename = function() {
paste0(file_path_sans_ext(filedata$name),"_genes_datatable_",input$fsel4,".csv")
paste0(file_path_sans_ext(filedata$name),"_genes_datatable_",input$fsel4,".csv")
},
content = function(file) {
write.csv(dtgoData(), file)
}
)
output$dlontodt <- renderUI ({ # Genes Page
req(dtgoData() !="")
downloadButton("dl_ontodt", label="")
......@@ -638,7 +641,7 @@ server <- function(input, output, session) {
paste0(file_path_sans_ext(filedata$name),"_",input$genes2,"_plot_",input$graph_compare,".svg")
} else {
paste0(file_path_sans_ext(filedata$name),"_",input$nsel2,"_plot_",input$graph_compare,".svg")
}
}
}
},
content = function(file) {
......@@ -684,7 +687,7 @@ server <- function(input, output, session) {
write.csv(cbar2Data(), file)
}
)
## Information Visualize text --------
output$information <- renderUI({
req(wrfile())
......@@ -758,7 +761,7 @@ server <- function(input, output, session) {
req(input$add %% 2 != 0)
selectizeInput("add_factor", "Add a Factor :", choices = names(rapply(wrfile()@meta.data, class=c("factor","character"), f=class)), selected = "orig.ident")
})
## Link the choices --
observeEvent ({
......@@ -918,19 +921,19 @@ The Heatmap is exportable in .png.", title=strong("Heatmap page Help"), easyClos
if (length(intersect(input$add_group1, input$add_group2)) != 0) {
showModal(modalDialog("Some cells are in common with your query. Please change some groups.", title=strong("Warning !"), easyClose=TRUE, footer = NULL ))
} else {
if (!exists("ffm")) {
ffm <- wrfile()
}
Idents(object=ffm) <- as.factor(paste0(eval(parse(text=paste0("wrfile()@meta.data$",input$fsel2))), eval(parse(text=paste0("wrfile()@meta.data$",input$add_factor)))))
df <- withProgress(data.frame(FindMarkers(ffm, paste0(input$library1_compare,input$add_group1), paste0(input$library2_compare, input$add_group2), test.use = "MAST")), message = "Preparing data", value=1)
setDT(df, keep.rownames = TRUE)[]
df <- data.frame(c(df,(input$fsel2)))
names(df)[[4]] <- paste("pct.",sapply(input$library1_compare, paste, collapse=""), collapse=" + ","in",sapply(input$add_group1, paste, collapse=""))
names(df)[[5]] <- paste("pct.",sapply(input$library2_compare, paste, collapse=""), collapse=" + ","in",sapply(input$add_group2, paste, collapse=""))
names(df)[[1]] <- "Gene"
names(df)[[7]] <- paste("",input$fsel2)
leftgenes <- df %>% top_n(30, df$avg_logFC)
rightgenes <- df %>% top_n(-30, df$avg_logFC)
if (!exists("ffm")) {
ffm <- wrfile()
}
Idents(object=ffm) <- as.factor(paste0(eval(parse(text=paste0("wrfile()@meta.data$",input$fsel2))), eval(parse(text=paste0("wrfile()@meta.data$",input$add_factor)))))
df <- withProgress(data.frame(FindMarkers(ffm, paste0(input$library1_compare,input$add_group1), paste0(input$library2_compare, input$add_group2), test.use = "MAST")), message = "Preparing data", value=1)
setDT(df, keep.rownames = TRUE)[]
df <- data.frame(c(df,(input$fsel2)))
names(df)[[4]] <- paste("pct.",sapply(input$library1_compare, paste, collapse=""), collapse=" + ","in",sapply(input$add_group1, paste, collapse=""))
names(df)[[5]] <- paste("pct.",sapply(input$library2_compare, paste, collapse=""), collapse=" + ","in",sapply(input$add_group2, paste, collapse=""))
names(df)[[1]] <- "Gene"
names(df)[[7]] <- paste("",input$fsel2)
leftgenes <- df %>% top_n(30, df$avg_logFC)
rightgenes <- df %>% top_n(-30, df$avg_logFC)
}
}
......@@ -982,7 +985,7 @@ The Heatmap is exportable in .png.", title=strong("Heatmap page Help"), easyClos
output$ontobutton <- renderUI ({
req(wrfile())
req(input$findmarkers)
actionButton(inputId="findonto", label=strong("Find Ontology"), icon = icon("fas fa-bookmark"))
actionButton(inputId="findonto", label=strong("Ontology"), icon = icon("fas fa-bookmark"))
})
observeEvent(input$findonto, {
......@@ -991,27 +994,27 @@ The Heatmap is exportable in .png.", title=strong("Heatmap page Help"), easyClos
showModal(modalDialog("At least one of the text area is empty !", title=strong("Warning !"), easyClose=TRUE, footer = NULL ))
} 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")
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)
})
output$dlontobutton_compare1 <- renderUI ({
downloadButton("dlonto_compare1", label="")
})
output$dlonto_compare1 <- downloadHandler(
filename = function() {
paste0(filedata$name,"_onto_",input$ontology2,"_datatable_",input$fsel2,".csv")
},
content = function(file) {
write.csv(dfo, file, row.names=FALSE)
}
)
}
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")
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)
})
output$dlontobutton_compare1 <- renderUI ({
downloadButton("dlonto_compare1", label="")
})
output$dlonto_compare1 <- downloadHandler(
filename = function() {
paste0(filedata$name,"_onto_",input$ontology2,"_datatable_",input$fsel2,".csv")
},
content = function(file) {
write.csv(dfo, file, row.names=FALSE)
}
)
}
})
## Compare Page - FindOntology Right --------
......
Markdown is supported
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