changeset 12:3d6b76f301c2 draft

planemo upload commit 4c04fd02dbe5234b3b1c524d65fb2de4c56e5a78-dirty
author proteore
date Tue, 16 Oct 2018 10:57:54 -0400
parents ddcc0347c54a
children bb92de0eb880
files topGO.xml topGO_enrichment.R
diffstat 2 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/topGO.xml	Tue Oct 16 10:28:50 2018 -0400
+++ b/topGO.xml	Tue Oct 16 10:57:54 2018 -0400
@@ -1,4 +1,4 @@
-<tool id="topGO" name="Enrichment analysis for Gene Ontology" version="2018.10.16">
+<tool id="topGO" name="Enrichment analysis for Gene Ontology" version="2018.10.16.2">
     <description>(Human, Mouse, Rat) (topGO)</description>
     <requirements>
         <requirement type="package" version="3.4.1">R</requirement>
--- a/topGO_enrichment.R	Tue Oct 16 10:28:50 2018 -0400
+++ b/topGO_enrichment.R	Tue Oct 16 10:57:54 2018 -0400
@@ -261,10 +261,8 @@
   }
   
   geneList = factor(as.integer(allGenes %in% sample)) 
-  if (levels(geneList) == "1" ){
-    stop("All background genes are found in tested genes dataset, enrichment analysis can't be done")
-  } else if (levels(geneList)== "0"){
-    stop("None of the background genes are found in tested genes dataset, enrichment analysis can't be done")
+  if (length(levels(geneList)) == 1 ){
+    stop("All or none of the background genes are found in tested genes dataset, enrichment analysis can't be done")
   }
   names(geneList) <- allGenes
   
@@ -333,16 +331,15 @@
     background_tab=read_file(background_genes,background_header)
     background_sample = unique(trimws(unlist(strsplit(background_tab[,background_column],";"))))
   }
+  #check of ENS ids
+  if (! any(check_ens_ids(background_sample))){
+    print("no ensembl gene ids found in your background ids list, please check your IDs in input or the selected column of your input file")
+    stop()
+  }
 } else {
   background_sample=NULL
 }
 
-#check of ENS ids
-if (! any(check_ens_ids(background_sample))){
-  print("no ensembl gene ids found in your background ids list, please check your IDs in input or the selected column of your input file")
-  stop()
-}
-
 # Launch enrichment analysis
 allresult = suppressMessages(goEnrichment(geneuniverse,sample,background_sample,onto))
 result = allresult[1][[1]]