I have a cnetplot from running enrichment with kegg using clusterprofiler. I have scores input as the fold change but for each gene in the plot they are not varying in colour to show their difference in the fold change score.
My dataset is genes of entrez IDs and then each gene has a score from 0.5-0.9 (instead of fold change) that I want to be able to see by colour code in the plot, is this possible or does the foldchange parameter only use fold change measures?
For example my data looks like this:
Gene Score 1234 0.9 5678 0.83 91011 0.89
I am then coding to get the cnetplot with:
kegg_enrich <- enrichKEGG(gene = df$Gene, organism = 'hsa', pvalueCutoff = 0.05, pAdjustMethod = 'fdr') kegg <- setReadable(kegg_enrich, 'org.Hs.eg.db', 'ENTREZID') kegg_genes <- kegg[,] gene_list_scores <- df$Scores gene_list_scores<-na.omit(gene_list_scores) gene_list_scores = sort(gene_list_scores, decreasing = TRUE) gene_of_interest <- dplyr::filter(kegg_genes, grepl('PTK2', geneID)) gene_of_interest<- enrichDF2enrichResult(gene_of_interest) options(ggrepel.max.overlaps = 1000) pother <- cnetplot(gene_of_interest, foldChange=gene_list_scores) pother + scale_color_gradientn(name = "Score", colours = c("blue", "red"))
I am expecting the
foldChange=gene_list_scores to enable each gene in the plot to be coloured by their score in my data but the plot output looks like: