I would like to know if this approach is correct. Briefly, I have a list of targets for a miR and I want to perform GO unsing topGO. TopGO needs a function (geneSel) telling it which genes to choose from the gene set, which is usually the differentially expressed ones. Since I have a list of genes (targets for the miR) I have no expression values and therefore, no sigincancies. So, this is what I did, but I am not sure if is correct:
1/ get all gene names:
mart <- useDataset("hsapiens_gene_ensembl", mart=useMart("ensembl"))
all_ensembl_gene_id <- getBM(attributes = "ensembl_gene_id",
values = "*", mart = mart)
2/ Select the targets IDs and give them value of 1. The rest of IDs in the set are 0s.
all <- factor(as.integer (all_ensembl_gene_id[,1] %in% targets))
names(all) <- all_ensembl_gene_id[,1]
3/ Perform gene ontology, choosing only targets (1's)
GOdata <- new("topGOdata",ontology = "CC",
allGenes = all,
geneSel=function(p) p == 1,
annot=annFUN.org, mapping="org.Hs.eg.db", ID="Ensembl")
Do you think this is a valid way to perform a GO. I am fairly new to this and I would appriciate your help very much.