Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
RRobert92 committed May 19, 2020
1 parent 2db0815 commit 24a36c1
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 35 deletions.
67 changes: 67 additions & 0 deletions ASGA/bin/Packages/Analysis/A_KMT_Minus_End_Seeds.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,72 @@

# Set-up analysis --------------------------------------------------------------
A_KMT_Minus_End_Seeds <- function (input, output, session){
# Analyze (-) ends nucleation from the KMT for Pole1 ---------------------------

total <- as.numeric(length(which(colnames(Segments) == "Pole1_00") : as.numeric(which(colnames(Segments) == "Pole2_00"))) - 1)

progressSweetAlert(
session = session, id = "P_nucleation1",
title = "Calculating (-) nucleated from the KMT for Pole1...",
display_pct = TRUE, value = 0
)

KMTs_minus_seed_P1 <- Minus_end_seed(which(colnames(Segments) == "Pole1_00"))

for(m in as.numeric(which(colnames(Segments) == "Pole1_00")+1):as.numeric(which(colnames(Segments) == "Pole2_00") - 1)){
tryCatch({
assign("DF",
Minus_end_seed(m))
KMTs_minus_seed_P1 <- rbind(KMTs_minus_seed_P1,
DF)
},
error = function(e){})

updateProgressBar(
session = session,
id = "P_nucleation1",
value = round((i - 1) / total * 100,
0)
)
Sys.sleep(0.1)
}
KMTs_minus_seed_P1 <<- KMTs_minus_seed_P1
closeSweetAlert(session = session)

# Analyze (-) ends nucleation from the KMT for Pole2 ---------------------------
total <- which(colnames(Segments) == colnames(Segments %>% select(starts_with("Pole")))[ncol(Segments %>% select(starts_with("Pole")))]) -
as.numeric(which(colnames(Segments) == "Pole2_00") - 1)

progressSweetAlert(
session = session, id = "P_nucleation2",
title = "Calculating (-) nucleated from the KMT for Pole2...",
display_pct = TRUE, value = 0
)

if(nrow(Pole2_00) == 0){
KMTs_minus_seed_P2 <- data.frame()

} else {
KMTs_minus_seed_P2 <- Minus_end_seed(which(colnames(Segments) == "Pole2_00"))

}

for(i in as.numeric(which(colnames(Segments) == "Pole2_00")+1) : as.numeric(ncol(Segments) - 4)){
tryCatch({
assign("DF",
Minus_end_seed(i))
KMTs_minus_seed_P2 <- rbind(KMTs_minus_seed_P2,
DF)
},
error = function(e){})
updateProgressBar(
session = session,
id = "P_nucleation2",
value = round((i - as.numeric(which(colnames(Segments) == "Pole2_00") - 1)) / total * 100,
0)
)
Sys.sleep(0.1)
}
KMTs_minus_seed_P2 <<- KMTs_minus_seed_P2
closeSweetAlert(session = session)
}
70 changes: 35 additions & 35 deletions ASGA/server.r
Original file line number Diff line number Diff line change
Expand Up @@ -71,38 +71,38 @@ function(input, output, session) {
# Relativity for Pre-Analysis -----------------------------------------------
observeEvent(input$`Submit`,{
callModule(PreAnalysis, "Home")

if(input$`Home-All_Anaysis` == TRUE){
callModule(A_KMT_number, "Home")
callModule(A_IKD, "Home")
callModule(A_Curvature, "Home")
callModule(A_End_Morphology, "Home")
callModule(A_Fiber_Area, "Home")
# callModule(A_KMT_Minus_End_Seeds, "Home")
}

if(input$`Home-KMT_number` == TRUE){
callModule(A_KMT_number, "Home")
}

if(input$`Home-IKD` == TRUE){
callModule(A_IKD, "Home")
}

if(input$`Home-Curvature` == TRUE){
callModule(A_Curvature, "Home")
}

if(input$`Home-End_Morphology` == TRUE){
callModule(A_End_Morphology, "Home")
}

if(input$`Home-Fiber_Area` == TRUE){
callModule(A_Fiber_Area, "Home")
}

# if(input$`Home-KMT_Minus_End_Seeds` == TRUE){
# callModule(A_KMT_Minus_End_Seeds, "Home")
# }
})
}
if(input$`Home-All_Anaysis` == TRUE){
callModule(A_KMT_number, "Home")
callModule(A_IKD, "Home")
callModule(A_Curvature, "Home")
callModule(A_End_Morphology, "Home")
callModule(A_Fiber_Area, "Home")
callModule(A_KMT_Minus_End_Seeds, "Home")
}
if(input$`Home-KMT_number` == TRUE){
callModule(A_KMT_number, "Home")
}
if(input$`Home-IKD` == TRUE){
callModule(A_IKD, "Home")
}
if(input$`Home-Curvature` == TRUE){
callModule(A_Curvature, "Home")
}
if(input$`Home-End_Morphology` == TRUE){
callModule(A_End_Morphology, "Home")
}
if(input$`Home-Fiber_Area` == TRUE){
callModule(A_Fiber_Area, "Home")
}
if(input$`Home-KMT_Minus_End_Seeds` == TRUE){
callModule(A_KMT_Minus_End_Seeds, "Home")
}
})
}

0 comments on commit 24a36c1

Please sign in to comment.