Skip to content

Instantly share code, notes, and snippets.

@vjcitn
Last active June 16, 2024 15:38
Show Gist options
  • Save vjcitn/39e8394abd680eaf7e5241d13b53988e to your computer and use it in GitHub Desktop.
Save vjcitn/39e8394abd680eaf7e5241d13b53988e to your computer and use it in GitHub Desktop.
function that will create a SingleCellExperiment by retrieving a serialized version of 'processed' PBMC 68k from Open Storage Network
get68proc = function(cache=BiocFileCache::BiocFileCache(),
targetfolder=tempdir()) {
zippath = "https://mghp.osn.xsede.org/bir190004-bucket01/BiocMatrixGenerics/pbmc68kproc.zip"
ent = BiocFileCache::bfcquery(cache, "pbmc68kproc.zip")
if (nrow(ent)==0) {
ent = BiocFileCache::bfcadd(cache, rname=zippath, action="copy")
}
refresh = BiocFileCache::bfcquery(cache, "pbmc68kproc.zip")
nzip = nrow(refresh)
ind = 1
if (nzip==0) stop("could not acquire zipfile from cache")
if (nzip > 1) {
message("multiple pbmc68kproc entries found, using last")
ind = nzip
}
entpath = refresh[ind,]$rpath
secon = utils::unzip(entpath, exdir=targetfolder)
HDF5Array::loadHDF5SummarizedExperiment(file.path(targetfolder, "p68_saved"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment