Oshlack / missMethyl

Bioconductor package for analysis of methylation data from Illumina's Infinium HumanMethylation arrays.
10 stars 4 forks source link

KEGG Api changes in gometh function cause 400 bad request error #19

Closed TinaXiayanLi closed 1 year ago

TinaXiayanLi commented 1 year ago

I think KEGG has update there API recently, so for PathID.PathName <- limma::getKEGGPathwayNames(species.KEGG = "Hsa", remove.qualifier = TRUE) in .getKEGG should fix Hsa to lower case.

Additionally, GeneID.PathID$PathwayID in .getKEGG is with prefix path:, which cause the problem align with the PathID.PathName$PathwayID to merge the table.

TinaXiayanLi commented 1 year ago

I have patch this function by this following code

.getKEGG <- function(){
  GeneID.PathID <- limma::getGeneKEGGLinks(species.KEGG = "hsa", convert = TRUE)
  isna <- rowSums(is.na(GeneID.PathID[, 1:2])) > 0.5
  GeneID.PathID <- GeneID.PathID[!isna, ]
  ID.ID <- paste(GeneID.PathID[, 1], GeneID.PathID[, 2], sep = ".")
  d <- !duplicated(ID.ID)
  GeneID.PathID <- GeneID.PathID[d, ]
  GeneID.PathID$PathwayID <- gsub("path:", "", GeneID.PathID$PathwayID)
  PathID.PathName <- limma::getKEGGPathwayNames(species.KEGG = "hsa", 
                                         remove.qualifier = TRUE)
  GeneID.PathID <- merge(GeneID.PathID, PathID.PathName, by="PathwayID")
  kegg <- tapply(GeneID.PathID$GeneID, GeneID.PathID$PathwayID, list)
  list(idList = kegg, idTable = PathID.PathName)
} 
bphipson commented 1 year ago

This has been fixed in the latest version of missMethyl. Please re-install the limma and missMethyl packages and give it another go.