I am using this package BSgenome.Hsapiens.UCSC.hg38 in a container on a compute cluster without internet access. When using this package, it attempts to download data and fails:
Error in download.file(url, destfile, quiet = TRUE) :
cannot open URL 'https://hgdownload.soe.ucsc.edu/goldenPath/hg38/database/chromInfo.txt.gz'
Calls: seqlevelsStyle<- ... .fetch_chrom_sizes_from_UCSC_database -> fetch_table_dump_from_UCSC -> fetch_table_from_url
Execution halted
Is there a way to point to a local path? What is the best way to deal with such issues in an offline environment?
Update: Added more complete code.
This is my code for running Cicero on Seurat objects based on this Signac vignette.
library(Seurat)
library(Signac)
library(cicero)
library(BSgenome.Hsapiens.UCSC.hg38)
library(dplyr)
seqlevelsStyle(BSgenome.Hsapiens.UCSC.hg38) <- "NCBI"
seqnames(BSgenome.Hsapiens.UCSC.hg38) <- BSgenome.Hsapiens.UCSC.hg38@seqinfo@seqnames
sf <- readRDS(file.path(path,"seurat.rds"))
mo <- SeuratWrappers::as.cell_data_set(sf)
co <- make_cicero_cds(mo, reduced_coordinates = reducedDims(mo)$UMAP)
# get the chromosome sizes from the Seurat object
genome <- as.data.frame(seqinfo(BSgenome.Hsapiens.UCSC.hg38)) %>%
tibble::rownames_to_column("chr") %>%
select(chr,seqlengths) %>%
slice(1:25)
conns <- run_cicero(co, genomic_coords = genome, sample_num = 100)
ccans <- generate_ccans(conns)
links <- ConnectionsToLinks(conns = conns, ccans = ccans)
Links(sf) <- links
It's not clear to me why (or that)
seqlevelsStyle
should be called on aBSgenome
object. You will need to provide more code that precedes the error so we can understand what you are trying to do.Updated with more code.