My sincere apologies that my colleagues had ignored your question.
The error occurs because the Gene Ontology annotations were not generated during the execution of the buildRef function, resulting in the absence of the Ontology.fst file. This file is created only when Gene Ontology data is successfully retrieved and processed for the specified species. The retrieval relies on the AnnotationHub package, which downloads organism-specific annotation databases such as org.Hs.eg.db for Homo sapiens. If an internet connection is unavailable or AnnotationHub encounters an issue, the ontology generation step fails silently, and the file is not produced.
To resolve this problem, first ensure that you have a stable internet connection. Then, install the necessary Bioconductor packages if they are not already present:
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(c("AnnotationHub", "GO.db", "org.Hs.eg.db"))
Next, rebuild the reference with the overwrite parameter set to TRUE to force regeneration:
ref_path <- file.path(tempdir(), "Reference")
buildRef(
reference_path = ref_path,
fasta = chrZ_genome(),
gtf = chrZ_gtf(),
ontologySpecies = "Homo sapiens",
overwrite = TRUE
)
After this, the Ontology.fst file should appear in the fst subdirectory, and the following command will succeed:
ontology <- viewGO(ref_path)
If the issue persists, test AnnotationHub access directly:
library(AnnotationHub)
ah <- AnnotationHub()
Any errors here indicate a configuration problem with AnnotationHub, such as proxy settings or cache directory permissions, which you must address according to the AnnotationHub documentation.
Kevin