Skip to content

Commit

Permalink
Implementation of multiple baseline-correction masks
Browse files Browse the repository at this point in the history
  • Loading branch information
ppernot committed Nov 19, 2019
1 parent 5fc6d2c commit 8bbd49c
Show file tree
Hide file tree
Showing 7 changed files with 760 additions and 248 deletions.
201 changes: 201 additions & 0 deletions data/data_ABC_IRF (copie).csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion global.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ for (lib in libs) {
dependencies = TRUE,
repos = "https://cran.univ-paris1.fr"
)
library(lib, quietly = TRUE)
library(lib, character.only = TRUE, quietly = TRUE)
}
}

Expand Down
2 changes: 2 additions & 0 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function(input, output, session) {
projConfig <- NULL
S0_in <- NULL
RawData <- NULL
masksBaseline <- c()
masksDl <- c()
masksWl <- c()
Inputs <- reactiveValues()
Expand All @@ -30,6 +31,7 @@ function(input, output, session) {
Inputs$wavlOrig = NULL
Inputs$delayOrig = NULL
Inputs$dlScaleFacOrig = NULL
Inputs$baselineMask = NA
Inputs$delayMask = NA
Inputs$wavlMask = NA
Inputs$maskSpExp = NA
Expand Down
45 changes: 18 additions & 27 deletions server_files/ALS.R
Original file line number Diff line number Diff line change
Expand Up @@ -1210,21 +1210,20 @@ output$alsOpt <- renderUI({
}
})

output$alsResid1 <- renderPlot(
{
output$alsResid1 <- renderPlot({
if (is.null(alsOut <- doALS())) {
return(NULL)
}

CS <- reshapeCS(alsOut$C, alsOut$S, ncol(alsOut$C))

if (isolate(input$useFiltered)) { # Choose SVD filtered matrix
if (isolate(input$useFiltered)) {
# Choose SVD filtered matrix
s <- doSVD()
CS1 <- reshapeCS(s$u, s$v, input$nSV)
mat <- matrix(0,
nrow = length(Inputs$delay),
ncol = length(Inputs$wavl)
)
ncol = length(Inputs$wavl))
for (ic in 1:input$nSV)
mat <- mat + CS1$C[, ic] %o% CS1$S[, ic] * s$d[ic]

Expand All @@ -1235,27 +1234,24 @@ output$alsResid1 <- renderPlot(
}
plotDatavsMod(Inputs$delay, Inputs$wavl, mat,
CS$C, CS$S,
main = main
)
main = main)
},
height = plotHeight
)
height = plotHeight)

output$alsResid3 <- renderPlot(
{
output$alsResid3 <- renderPlot({
if (is.null(alsOut <- doALS())) {
return(NULL)
}

CS <- reshapeCS(alsOut$C, alsOut$S, ncol(alsOut$C))

if (isolate(input$useFiltered)) { # Choose SVD filtered matrix
if (isolate(input$useFiltered)) {
# Choose SVD filtered matrix
s <- doSVD()
CS1 <- reshapeCS(s$u, s$v, input$nSV)
mat <- matrix(0,
nrow = length(Inputs$delay),
ncol = length(Inputs$wavl)
)
ncol = length(Inputs$wavl))
for (ic in 1:input$nSV)
mat <- mat + CS1$C[, ic] %o% CS1$S[, ic] * s$d[ic]

Expand All @@ -1266,27 +1262,24 @@ output$alsResid3 <- renderPlot(
}
plotResid(Inputs$delay, Inputs$wavl, mat,
CS$C, CS$S,
main = main
)
main = main)
},
height = plotHeight
)
height = plotHeight)

output$alsResid2 <- renderPlot(
{
output$alsResid2 <- renderPlot({
if (is.null(alsOut <- doALS())) {
return(NULL)
}

CS <- reshapeCS(alsOut$C, alsOut$S, ncol(alsOut$C))

if (isolate(input$useFiltered)) { # Choose SVD filtered matrix
if (isolate(input$useFiltered)) {
# Choose SVD filtered matrix
s <- doSVD()
CS1 <- reshapeCS(s$u, s$v, input$nSV)
mat <- matrix(0,
nrow = length(Inputs$delay),
ncol = length(Inputs$wavl)
)
ncol = length(Inputs$wavl))
for (ic in 1:input$nSV)
mat <- mat + CS1$C[, ic] %o% CS1$S[, ic] * s$d[ic]

Expand All @@ -1297,11 +1290,9 @@ output$alsResid2 <- renderPlot(
}
plotResidAna(Inputs$delay, Inputs$wavl, mat,
CS$C, CS$S,
main = main
)
main = main)
},
height = plotHeight
)
height = plotHeight)

rangesAlsKin <- reactiveValues(x = NULL, y = NULL)

Expand Down
Loading

0 comments on commit 8bbd49c

Please sign in to comment.