Entering edit mode
2.5 years ago
park.seojeong2
•
0
Hi, guys. I have got an error using topGO. Could you check my scripts and say what is something wrong with me?
> coreGenes <- read.table("go_annotations.txt")`
> head(coreGenes)
# MSTRG.10.1 GO:0003674,GO:0003824,GO:0004175,GO:0004190,GO:0005575
# MSTRG.100.1 GO:0000166,GO:0003674,GO:0003676,GO:0005488
# MSTRG.1004.1 GO:0003674,GO:0005488,GO:0005575,GO:0005576
# MSTRG.1006.1 GO:0003674,GO:0003676,GO:0003824,GO:0003964
# MSTRG.1007.1 GO:0003674,GO:0003824,GO:0004497,GO:0005488
# MSTRG.1008.1 GO:0003674,GO:0003824,GO:0004497,GO:0005488,GO:0005506
> geneID2GO <- readMappings("gene2go")
> str(head(geneID2GO))
#List of 6
# $ #tax_id: chr "GeneID"
# $ 3702 : chr "814629"
# $ 3702 : chr "814629"
# $ 3702 : chr "814630"
# $ 3702 : chr "814630"
# $ 3702 : chr "814630"
> geneNames <- names(geneID2GO)
> head(geneNames)
#[1] "#tax_id" "3702" "3702" "3702" "3702" "3702"
> myInterestingGenes <- sample(geneNames, length(geneNames) / 10)
> geneList <- factor(as.integer(geneNames %in% myInterestingGenes))
> names(geneList) <- geneNames
> str(geneList)
# Factor w/ 2 levels "0","1": 1 2 2 2 2 2 2 2 2 2 ...
# - attr(*, "names")= chr [1:2161655] "#tax_id" "3702" "3702" "3702" ...
> GOdata <- new("topGOdata", ontology = "BP", allGenes = geneList,
annot = annFUN.gene2GO, gene2GO = geneID2GO)
###########################
Building most specific GOs .....
( 0 GO terms found. )
Build GO DAG topology ..........
( 0 GO terms and 0 relations. )
Nothing to do:
Error in split.default(names(sort(nl)), f.index) :
first argument must be a vector
I have searched several websites to use topGO for non-model organisms and scripts worked!
However, that scripts do not work today.
Maybe something went wrong during the organization and save process of scripts.
What did I wrong?
Thank you in advance.
Check the manual/docs. I think that readMappings() is meant to read a custom annotation file, e.g. your file "go_annotations.txt". Currently your geneID2GO doesn't seem to contain any GO term. Also for enrichment analysis I think the topGOData object should contain two lists of genes.
Thank you for your rely! You mean I have to change data uploaded as geneID2GO first, aren't you? And you said "topGOData object should contain two lists of genes.". Does it means that i need to change scripts for topGOData to have two lists of gene? Could you show me an example? I'm not used to using r...
I haven't used topGO in a while so don't remember the details. However, Bioconductor packages are generally well documented. Check the topGO package vignette for examples.
Why did you delete the post, park.seojeong2 ?