我想運行這個文件並繪製基於該值,我也用ui.R腳本來打開文件。如何確定R腳本不工作的原因?
library(shiny)
library (flowCore)
library(flowViz)
shinyServer (function(input, output,server){
# trying to open a file
ff <- input$file
str(input$file)
# to read a fcs file from a flow cytometer
read.FCS("input$file",
transformation="linearize",
alter.names=FALSE,
column.pattern=NULL,
invert.pattern = FALSE,
decades=0,
ncdf=FALSE, min.limit=NULL,
truncate_max_range = TRUE,
dataset=NULL,
emptyValue=TRUE)
filedata <- reactive
({
ff <- input$file
str(input$file)
read.FCS("input$file",
transformation="linearize",
alter.names=FALSE,
column.pattern=NULL,
invert.pattern = FALSE,
decades=0,
ncdf=FALSE, min.limit=NULL,
truncate_max_range = TRUE,
dataset=NULL,
emptyValue=TRUE)
output$distPlot <- renderPlot
({
lg <- rectangleGate("FS INT LIN"=c(350,700),"SS INT LIN"=c(50,250))
lymp <- Subset(ff,lg)
# to compensate the values
bx<-biexponentialTransform()
bx1<-transformList(c("FL1 INT LOG","FL4 INT LOG"),bx)
bx2<-transformList(c("FL4 INT LOG","FL2 INT LOG"),bx)
bx3<-transformList(c("FL4 INT LOG","FL3 INT LOG"),bx)
CD45CD3<-transform(lymp,bx1)
CD3CD4<-transform(lymp,bx2)
CD3CD8<-transform(lymp,bx3)
# generate bins based on input$bins from ui.R
plot (ff, c("FS INT LIN","SS INT LIN"),xlim = c(100,1050),ylim=c(-10,900),
nbin=260)
xyplot(`SS INT LIN` ~ `FS INT LIN`,ff,filter=lg)
plot(lymp, c("FL1 INT LOG","FL2 INT LOG"),xlim = c(100,1050),ylim=
c(-10,900), nbin=260)
})
# i want to run this app
})
shinyApp(ui=ui,server=server)
runApp("flowcyto", display.mode = "showcase")
}
)
我曾嘗試使用我在這裏看到的幾篇文章,但似乎沒有工作。我正在努力重新創建一個基於流程細胞的自動化分析系統,第一步是調用文件並繪製相應的圖。 我得到的錯誤是:
Warning: Error in .getReactiveEnvironment()$currentContext: Operation not allowed without an active reactive context. (You tried to do something that can only be done from inside a reactive expression or observer.)
Stack trace (innermost first):
46: .getReactiveEnvironment()$currentContext
45: .subset2(x, "impl")$get
44: $.reactivevalues
43: $ [C:\Users\ramaswamynathan.v\Desktop\r script\flowcyto/server.R#14]
42: server [C:\Users\ramaswamynathan.v\Desktop\r script\flowcyto/server.R#14]
1: runApp
Error in .getReactiveEnvironment()$currentContext() :
Operation not allowed without an active reactive context. (You tried to do something that can only be done from inside a reactive expression or observer.)
庫(閃亮)
# Define UI for application that draws a histogram
shinyUI(fluidPage(
# Application title
titlePanel("FLOW CYTOMETRY DATA"),
titlePanel("Flow Cytometry"),
# Upload File
fileInput("file", label = h3("File input")),
hr(),
fluidRow(column(4, verbatimTextOutput("value")))
)) 我現在UI頁面只是從一個位置打開該文件,並用它來運行我的程序。
我已經整理了一些問題,但總的來說,我認爲你是說這是「無法正常工作」。當它歸結時,這不是一個非常具體的錯誤報告,那麼你會更具體嗎?劇本是做什麼的?它運行嗎?它會產生錯誤的結果嗎?他們以何種方式錯了? (我已經修剪了關於多個情節的第二個問題,因爲這感覺像是一個無關的問題,可以研究,並且在你解決這個問題之後詢問是否有必要)。 – halfer
該頁面加載並向我顯示以下錯誤,非常感謝您的幫助 –