Infinite Recursion Shiny(solved)

shiny

#1

Hi, I´m trying to run an Gene Ontology analysis but I got an infinite recursion error and I don't Know where is is.

#server

#toptable results from ebayes function
results <- reactive({
  results1 <- cbind(genesymbols(), toptable())
  results1 <- na.omit(results1)
})


#selected genes from results table by an input value choosen by the user

selected <- reactive({
  
  selected <- results()[which(results()$adj.P.Val <= input$pvalue),]
  selected <- selected[1:input$ngenes,]
})

##Create topGo data Object

#geneID
geneID <- reactive ({
  geneid <- rownames(results())
  return(geneid)
})

#List of interesting genes

myInterestingGenes <- reactive({
  myInterestingGenes <- rownames(selected())
  return(myInterestingGenes)
})

#till here the functions works fine

#Here is the problem

#GeneList for top go data

geneList <- reactive({
  
 geneList <- factor(as.integer(geneID() %in% myInterestingGenes()))
  names(geneList) <- geneID()
  return(geneList())
})

So i have the error in the last function and I can't figure how solve the problem


#2

To me it looks like

geneList <- reactive({
  
 geneList <- factor(as.integer(geneID() %in% myInterestingGenes()))
  names(geneList) <- geneID()
  return(geneList())
})

Your return statement for the reactive is calling itself, return(geneList() which returns "evaluate reactive" should be return(geneList) which returns "geneList object"


#3

What a dumb mistake, thank you!


#4

If your problem has been solved :raised_hands: , here’s the best way to mark the solution: