Enrichment Analysis: Differences in CrossReferencing function between MetaboAnalystR 4.0 and MetaboAnalyst6.0

Hi MetaboAnalyst Team,

I am continuously working on a dataset using MetaboAnalystR v.4.0 and found errors while re-running my previously functioning code for the enrichment analyses. Here is a snippet of the code with specific HMDBs of my data set.

mset<-InitDataObjects(“conc”, “msetora”, FALSE)
mset<-Setup.MapData(mset, cmpd.vec);
mset<-CrossReferencing(mset, “hmdb”, lipid = T);

I get the following error message:
[1] “Loaded files from MetaboAnalyst web-server.”
[1] “0”
[2] “Over half of the compound IDs could not be matched to our database. Please make \n sure that correct compound IDs or common compound names are used.”
[1] “Name matching failed! Please make sure that correct standardized feature names are used!”

Since that code worked before for the same metabolites and HMDB IDs, I tested the HMDBs on the website using MetaboAnalyst6.0, and here every HMDB ID was correctly identified.

I see there were some errors in the forum related to that issue, but I did not find a topic focusing on differences between the R version and the online version. Is there maybe an error due to the recent * Fixed name mapping issue associated with latest HMDB IDs and KEGG IDs (01/14/2024) * ?

Thanks for your help.



I wanted to pin this question again as I still encounter issues using MetaboAnalyst R. For instance I have the following HMDB IDs:


Using the enrichment analysis on the website, all of them are recognized and the enrichment results look like this (lipids chosen and sub-class):

However, when I put in the same HMDB IDs MetaboAnalyst R with the same code (copied from the website), I get the following results:


As you can see, there is a clear difference between the websites and the R-version results. It would be really great if someone could help me.

Thanks a lot

Hi David, have you tried removing the libraries (.qs files) that may have been previously downloaded in the working directory? It seems like the local environment is using a different version of the subclass library from the website. Hope it helps!


I de-installed and installed the whole package, because I did not find any .qs files within the libraries. Unfortunately, the error is still the same. How could I remove libraries or update them? (Windows, no advanced computational skills, tried to google over the last days, but didn’t a good answer).


Hi !
Did you find a solution to this error? I am facing a similar issue and tried removing all the .qs files as well …

Hi Shanthini,

no, unfortunetaly, I did not find a solution. I ended up doing the analysis online, downloading the CSV files and creating figures based on the CSV files in R. Would be great if the team could take another look at that, if it seems to persist.