## ----setup, include=FALSE----------------------------------------------------- knitr::opts_chunk$set(cache = TRUE) ## ----eval=FALSE--------------------------------------------------------------- # if (!requireNamespace("BiocManager", quietly = TRUE)) # install.packages("BiocManager") # # BiocManager::install("waldronlab/TENxIO") ## ----include=TRUE,results="hide",message=FALSE,warning=FALSE------------------ library(TENxIO) ## ----------------------------------------------------------------------------- showClass("TENxFile") ## ----------------------------------------------------------------------------- hub <- ExperimentHub::ExperimentHub() hub["EH1039"] ## ----eval=FALSE--------------------------------------------------------------- # fname <- hub[["EH1039"]] # TENxFile(fname, extension = "h5", group = "mm10", version = "2") ## ----------------------------------------------------------------------------- TENxIO:::h5.version.map ## ----------------------------------------------------------------------------- h5f <- system.file( "extdata", "pbmc_granulocyte_ff_bc_ex.h5", package = "TENxIO", mustWork = TRUE ) library(rhdf5) h5ls(h5f) ## ----------------------------------------------------------------------------- con <- TENxH5(h5f) con ## ----------------------------------------------------------------------------- import(con) ## ----------------------------------------------------------------------------- mtxf <- system.file( "extdata", "pbmc_3k_ff_bc_ex.mtx", package = "TENxIO", mustWork = TRUE ) con <- TENxMTX(mtxf) con ## ----------------------------------------------------------------------------- import(con) ## ----------------------------------------------------------------------------- fl <- system.file( "extdata", "pbmc_granulocyte_sorted_3k_ff_bc_ex_matrix.tar.gz", package = "TENxIO", mustWork = TRUE ) untar(fl, list = TRUE) ## ----------------------------------------------------------------------------- con <- TENxFileList(fl) import(con) ## ----------------------------------------------------------------------------- pfl <- system.file( "extdata", "pbmc_granulocyte_sorted_3k_ex_atac_peak_annotation.tsv", package = "TENxIO", mustWork = TRUE ) tenxp <- TENxPeaks(pfl) peak_anno <- import(tenxp) peak_anno ## ----------------------------------------------------------------------------- fr <- system.file( "extdata", "pbmc_3k_atac_ex_fragments.tsv.gz", package = "TENxIO", mustWork = TRUE ) ## ----------------------------------------------------------------------------- tfr <- TENxFragments(fr) tfr ## ----------------------------------------------------------------------------- fra <- import(tfr) fra ## ----------------------------------------------------------------------------- rowRanges(fra) ## ----eval=FALSE--------------------------------------------------------------- # TENxVisium( # resource = "path/to/10x/visium/file.tar.gz", # spatialResource = "path/to/10x/visium/spatial/file.spatial.tar.gz", # sample_id = "sample01", # images = c("lowres", "hires", "detected", "aligned"), # jsonFile = "scalefactors_json.json", # tissuePattern = "tissue_positions.*\\.csv", # spatialCoordsNames = c("pxl_col_in_fullres", "pxl_row_in_fullres") # ) ## ----------------------------------------------------------------------------- sessionInfo()