This is a test version of Biostars. For the public version, visit https://www.biostars.org.
GO annotation in R using library(org.Hs.eg.db)

I have a list of genes of from a transcriptomic analysis that I wanted to annotate with GO terms using R.

My dataframe looks like this;

Module & Cluster    Gene    Ensembl_ID  Gene_Symbol log2FC_L.C  FC_L.C  p_L.C   q_L.C   log2FC_LD.C FC_LD.C p_LD.C  q_LD.C          
M1C1    CXCL10  ENSSSCG00000032474  CXCL10  6.943   123.066 1.41E-72    1.6E-70 6.658   101.007 6.89E-67    7.23E-65    -0.285      
M1C1    EDN1    ENSSSCG00000035598  EDN1    6.857   115.899 1.02E-61    8.59E-60    6.299   78.742  2.59E-52    1.78E-50    -0.558  
M1C1    IFNB1   ENSSSCG00000005163  IFNB1   6.536   92.819  2.43E-22    4.83E-21    5.8 55.716  9.31E-18    1.28E-16    -0.736  0.6     
M1C1    F3  ENSSSCG00000022447  F3  6.507   90.981  1.97E-88    4E-86   6.424   85.883  3.15E-86    5.99E-84    -0.083  0.944

I created a vector with the Gene ID to be used as the SYMBOL key in the code as shown below;

library(clusterProfiler)
library(org.Hs.eg.db)  

annots <- select(
  org.Hs.eg.db,
  keys = dataframe$Gene,
  columns = c("SYMBOL", "GENENAME", "GO"),
  keytype = "SYMBOL"
)

But I keep getting the error;

Error in UseMethod("select") : 
  no applicable method for 'select' applied to an object of class "c('OrgDb', 'AnnotationDb', 'envRefClass', '.environment', 'refClass', 'environment', 'refObject', 'AssayData')"

I'm not sure how to fix it. I thought the package should be able to recognize the gene names. I'm not sure if my dataframe is in the wrong format or not. Or perhaps I'm using the wrong command. This is my first time using this package.

go bioconductor

Be cautious using pig genes with human GO annotations.

2 answers

Why are you using Human AnnotationData Package for you pig genes? Please see the correct AnnotationData Package for your model organism in the link below-

https://www.bioconductor.org/packages/release/data/annotation/

The code below will probably work-

library(clusterProfiler)
library(org.Ss.eg.db)  ##This is the pig AnnotationData Package

annots <- select(
  org.Ss.eg.db,
  keys = as.character(dataframe$Gene),
  columns = c("SYMBOL", "GENENAME", "GO"),
  keytype = "SYMBOL"
)

OMG, I totally forgot to change the package to pig. Thanks so much for your help!

Log in to answer this question.