Last active
June 16, 2024 15:38
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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