Hello,
I am trying to run clusterProfiler for my RNA-seq analysis and I'm unable to generate the KEGG graph. I followed the tutorial mentioned in https://learn.gencore.bio.nyu.edu/rna-seq-analysis/gene-set-enrichment-analysis/ . The KEGGgse object has a ID vector which contains all the KEGG pathway codes such as "ath04016" "ath00460" "ath00966" "ath04626" "ath03440". I ran a for loop to extract the pathways and display the results using pathview, but I am getting the same error message for every pathway. I also tried it without the "ath" in the pathway.id, but I am still not able to extract any pathways. Am I doing something wrong or is pathview just not working?
Thanks!
kegg_gene_list <- df2$log2FoldChange
kegg_organism = "ath"
kk2 <- gseKEGG(geneList = kegg_gene_list,
organism = kegg_organism,
nPerm = 10000,
minGSSize = 3,
maxGSSize = 800,
pvalueCutoff = 0.05,
pAdjustMethod = "none",
keyType = "ncbi-geneid")
library(pathview)
#for (i in kk2$ID)
#{
# Produce the native KEGG plot (PNG)
#png("ath04075.pathview.png")
dme <- pathview(gene.data=kegg_gene_list, pathway.id="04016", species = kegg_organism)
#dev.off()
# Produce a different plot (PDF) (not displayed here)
#png("ath040751.pathview.png")
dme <- pathview(gene.data=kegg_gene_list, pathway.id="ath04016", species = kegg_organism, kegg.native = F)
#dev.off()
#knitr::include_graphics("ath04075.pathview.png", error = FALSE)
#}
This is the output:
Info: Getting gene ID data from KEGG...
Info: Done with data retrieval!
Info: Downloading xml files for ath04016, 1/1 pathways..
Warning in download.file(xml.url, xml.target, quiet = T) :
URL 'https://rest.kegg.jp/get/ath04016/kgml': status was 'Failure when receiving data from the peer'
Warning: Download of ath04016 xml file failed!
This pathway may not exist!
Info: Downloading png files for ath04016, 1/1 pathways..
Warning: Download of ath04016 png file failed!
This pathway may not exist!
Warning: Failed to download KEGG xml/png files, ath04016 skipped!
Thanks for the update! I tried the PR as you mentioned but it's still not working. I attached the code below.
``` remove.packages("pathview") Removing package from ‘AppData/Local/Programs/R/R-4.2.0/library’ (as ‘lib’ is unspecified)
Warning: package ‘pathview’ is in use and will not be installed
dme <- pathview(gene.data=kegg_gene_list, pathway.id="04016", species = kegg_organism) Info: Getting gene ID data from KEGG... Info: Done with data retrieval! Info: Downloading xml files for ath04016, 1/1 pathways.. Warning in download.file(xml.url, xml.target, quiet = T) : URL 'https://rest.kegg.jp/get/ath04016/kgml': status was 'Failure when receiving data from the peer' Warning: Download of ath04016 xml file failed! This pathway may not exist! Info: Downloading png files for ath04016, 1/1 pathways.. Warning: Download of ath04016 png file failed! This pathway may not exist! Warning: Failed to download KEGG xml/png files, ath04016 skipped!
Did you see this message:
Warning: package ‘pathview’ is in use and will not be installed
? So it seems the PR was not installed.I suggest to close all R instances and restart it. Then run
devtools::install_github("javadnoorb/pathview", force=TRUE)
.Also: run
BiocManager::valid()
and act accordingly. Based on the messageSkipping 4 packages ahead of CRAN
it may be that your Bioconductor installation is not 'matched' (I don't get that notification when installing the PR).Lastly, since it is difficult to troubleshoot without having the data you are using, it is also good to check whether the example code on the help page of
pathview
(type:?pathview
) is working. It should!Thank you so much for your help!
I noticed the warning message a little too late, but it seems to be working now. I used the following code:
``` detach("package:pathview", unload = TRUE) devtools::install_github("javadnoorb/pathview") library(pathview) dme <- pathview(gene.data=kegg_gene_list, pathway.id="04016", species = kegg_organism)