title: Enrichment of GO terms of a set of genes using TopGO
body: <p>I am trying to derive a list of enriched GO terms from a set of genes given by a user. The way I understand and am implementing is:</p>
  
  <p>My input is a csv file consisting of about 500 genes.</p>
  
  <pre><code>&gt;library(topGO)        
  &gt;library(hgu133plus2.db)
  &gt;all.genes &lt;- ls(hgu133plus2ACCNUM) # I guess, this creates my gene universe
  
  &gt;data &lt;- read.csv(file.choose(),header=FALSE) #Here I give an input csv file containing     genes
  
  &gt;relevant.genes &lt;- factor(as.integer(all.genes %in% data)
  &gt;names(relevant.genes) &lt;- all.genes
  &gt;GOdata.BP &lt;- new("topGOdata", ontology='BP', allGenes = relevant.genes, annotationFun =annFUN.db, affyLib = 'hgu133plus2.db')
  </code></pre>
  
  <p>I get the following error after this:</p>
  
  <pre><code>Error in .local(.Object, ...) : allGenes must be a factor with 2 levels
  &gt; str(relevant.genes)
  Factor w/ 1 level "0": 1 1 1 1 1 1 1 1 1 1 ...
  - attr(*, "names")= chr [1:54675] "1007_s_at" "1053_at" "117_at" "121_at" ...
  </code></pre>
  
  <p>Can you please direct me where am I going wrong? Am I right in using TopGO for this, even though I dont have expression values.</p>