utility for dealing with cached Xen_SPEP in temp folder

reset_parq_paths(xsp, base)

Arguments

xsp

instance of XenSPEP

base

folder path where parquet files are found

Note

Will prepend current folder path to parquet-oriented slot values.

Examples

prp = cache_xen_prost() # parquet paths are pre-set :(
dir.create(td <- file.path(tempdir(), "xen_work"))
unzip(prp, exdir=td)
ini = HDF5Array::loadHDF5SummarizedExperiment(file.path(td, "xen_prost"))
fin = reset_parq_paths(ini, base=td)
print(fin)
#> XenSPEP instance.  SCEcomponent:
#> class: SingleCellExperiment 
#> dim: 5006 193000 
#> metadata(0):
#> assays(1): counts
#> rownames: NULL
#> rowData names(3): ID Symbol Type
#> colnames(193000): aaaagkdm-1 aaaamcnn-1 ... oioglipl-1 oiohaagd-1
#> colData names(15): cell_id x_centroid ... segmentation_method sample_id
#> reducedDimNames(0):
#> mainExpName: Gene Expression
#> altExpNames(5): Deprecated Codeword Genomic Control Negative Control
#>   Codeword Negative Control Probe Unassigned Codeword
#> use spatialCoords() for cell centroids.
#> Geometry element paths (not loaded):
#>  /home/vincent/TEMP/Rtmptq2R9O/xen_work/cell_boundaries.parquet
#>  /home/vincent/TEMP/Rtmptq2R9O/xen_work/nucleus_boundaries.parquet
#>  /home/vincent/TEMP/Rtmptq2R9O/xen_work/transcripts.parquet
txloc = arrow::read_parquet(slot(fin, "tx_path"), as_data_frame=FALSE) # premature
txloc |> dplyr::count() |> dplyr::collect()
#> # A tibble: 1 × 1
#>          n
#>      <int>
#> 1 59727355
fin = loadGeometry(fin) # proper
slot(fin, "txtab")
#> Table
#> 59727355 rows x 13 columns
#> $transcript_id <uint64>
#> $cell_id <string>
#> $overlaps_nucleus <uint8>
#> $feature_name <string>
#> $x_location <float>
#> $y_location <float>
#> $z_location <float>
#> $qv <float>
#> $fov_name <string>
#> $nucleus_distance <float>
#> $codeword_index <int32>
#> $codeword_category <string>
#> $is_gene <bool>
#> 
#> See $metadata for additional Schema metadata
slot(fin, "txtab") |> dplyr::count() |> dplyr::collect()
#> # A tibble: 1 × 1
#>          n
#>      <int>
#> 1 59727355