Don't let TopGo to trimm long GO names
2
1
Entering edit mode
3.9 years ago
Apex92 ▴ 280

I'm using TopGo to do GO analyses. When I get my enriched terms, the long term names get corrupted. I have some text then .... For example:

GO:0000122  negative regulation of transcription by ...
GO:0006886  intracellular protein transport
GO:0010976  positive regulation of neuron projection...

Any help would be appreciated?

My entire code:

library(topGO)
library(GO.db)
library(biomaRt)
library(Rgraphviz)
library(tidyverse)
library(dbplyr)

prebg_genes <- read.table("mart_mmu_protein_coding_genes.csv", header=F, sep=",")
bg_genes <- as.character(prebg_genes[,1])

pre_candidate_list_1 <- read.table("All_targets_ENSMUSG.txt", header=T, sep=",")
candidate_list_1= as.character(pre_candidate_list_1[,1])

db <- useMart('ENSEMBL_MART_ENSEMBL',dataset='mmusculus_gene_ensembl', host="www.ensembl.org")
go_ids <- getBM(attributes=c('go_id', 'ensembl_gene_id', 'namespace_1003'), filters='ensembl_gene_id', values=bg_genes, mart=db)
go_ids <- read.table("go_ids_mmu_protein_coding_genes.txt", header=T, sep="\t")
listAttributes(db)
View(go_ids)

gene_2_GO <- unstack(go_ids[,c(1,2)])

pre_keep1 <- candidate_list_1 %in% go_ids[,2]
keep1 <- which(pre_keep1==TRUE)
candidate_list_final1 <- candidate_list_1[keep1]

geneList1 <- factor(as.integer(bg_genes %in% candidate_list_final1))
names(geneList1) <- bg_genes

GOdata1 <- new('topGOdata', ontology='BP', allGenes = geneList1, annot = annFUN.gene2GO, gene2GO = gene_2_GO)

classic_fisher_result1 <- runTest(GOdata1, algorithm='classic', statistic='fisher')

weight_fisher_result1 <- runTest(GOdata1, algorithm='weight01', statistic='fisher') 

applied to the topGOdata object.
allGO1 <- usedGO(GOdata1)
all_res1 <- GenTable(GOdata1, weightFisher=weight_fisher_result1, orderBy='weightFisher', topNodes=length(allGO1))

p.adj1 <- round(p.adjust(all_res1$weightFisher,method="BH"),digits = 4)

pre_all_res_final1=cbind(all_res1,p.adj1)
all_res_final1 <- pre_all_res_final1[order(pre_all_res_final1$p.adj1),]
write.table(all_res_final1,"summary_topGo_analysis_all_DE_miRs_targets.csv",sep=",",quote=F)
topgo RNA-Seq software error next-gen goenrichment • 2.4k views
ADD COMMENT
3
Entering edit mode
3.9 years ago
Apex92 ▴ 280

I found the answer in Github. So basically we have to add numChar=1000 to all_res1 i.e:

all_res1 <- GenTable(GOdata1, weightFisher=weight_fisher_result1, orderBy='weightFisher', topNodes=length(allGO1), numChar=1000)

numChar: truncates GO term descriptions at 1000 chars (basically, disables truncation)

ADD COMMENT
1
Entering edit mode
3.9 years ago
Lluís R. ★ 1.2k

Crossposted on Bioconductor: https://support.bioconductor.org/p/131412/

ADD COMMENT

Login before adding your answer.

Traffic: 2649 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6