organism = "org.Mm.eg.db"
#1.I choose all the genes
original_gene_list <- deg_2v1$log2FC
names(original_gene_list) <- rownames(deg_2v1)
gene_list = na.omit(original_gene_list)
gene_list = sort(gene_list, decreasing = TRUE)
#2.I choose the significent differential genes
sig_genes_df = genedif_2V1
genes = deg_2v1[genedif_2V1,1]
names(genes) = sig_genes_df
genes = sort(genes, decreasing = T)
genes = names(genes)
#3.enrichment analysis
go_enrich <- enrichGO(gene = genes,
universe = names(gene_list),
OrgDb = organism,
keyType = 'SYMBOL',
readable = T,
ont = "BP",
pvalueCutoff = 0.05,
qvalueCutoff = 0.10)
#the results of enrichment analysis showed below:
Error in names(x) <- value :
'names' attribute [2] must be the same length as the vector [1]
if I use the "genes" to replace the "names(gene_list)" at the parameter "universe", the result is the same.
could you give me some help? I don't know how to deal with the problem.
organism = "org.Mm.eg.db"
#1.I choose all the genes
original_gene_list <- deg_2v1$log2FC
names(original_gene_list) <- rownames(deg_2v1)
gene_list = na.omit(original_gene_list)
gene_list = sort(gene_list, decreasing = TRUE)
#2.I choose the significent differential genes
sig_genes_df = genedif_2V1
genes = deg_2v1[genedif_2V1,1]
names(genes) = sig_genes_df
genes = sort(genes, decreasing = T)
genes = names(genes)
#3.enrichment analysis
go_enrich <- enrichGO(gene = genes,
universe = names(gene_list),
OrgDb = organism,
keyType = 'SYMBOL',
readable = T,
ont = "BP",
pvalueCutoff = 0.05,
qvalueCutoff = 0.10)
#the results of enrichment analysis showed below:
Error in names(x) <- value :
'names' attribute [2] must be the same length as the vector [1]
if I use the "genes" to replace the "names(gene_list)" at the parameter "universe", the result is the same.
could you give me some help? I don't know how to deal with the problem.