H5ADMatrixSeed objects
H5ADMatrixSeed-class.Rd
H5ADMatrixSeed is a low-level helper class used to represent a pointer
to the central matrix stored of an h5ad
file, or to one of the
matrices in the /layers
group.
It is a virtual class with three concrete subclasses: Dense_H5ADMatrixSeed, CSC_H5ADMatrixSeed, and CSR_H5ADMatrixSeed:
The Dense_H5ADMatrixSeed class is used when the matrix is stored as a conventional HDF5 dataset in the
h5ad
file. It is a direct entension of the HDF5ArraySeed class.The CSC_H5ADMatrixSeed or CSR_H5ADMatrixSeed classes is used when the matrix is stored in the Compressed Sparse Column or Compressed Sparse Row format in the
h5ad
file. CSC_H5ADMatrixSeed is a direct entension of CSC_H5SparseMatrixSeed, and CSR_H5ADMatrixSeed a direct entension of CSR_H5SparseMatrixSeed.
Note that an H5ADMatrixSeed derivative is not intended to be used directly.
Most end users will typically create and manipulate a higher-level
H5ADMatrix object instead. See ?H5ADMatrix
for
more information.
Arguments
- filepath, layer
See
?H5ADMatrix
for a description of these arguments.
Details
Dense_H5ADMatrixSeed objects support the same limited set of methods as
HDF5ArraySeed objects, and CSC_H5ADMatrixSeed and CSR_H5ADMatrixSeed
objects support the same limited set of methods as H5SparseMatrixSeed
objects.
See ?HDF5ArraySeed
and ?H5SparseMatrixSeed
for the details.
Value
H5ADMatrixSeed()
returns an H5ADMatrixSeed derivative
(Dense_H5ADMatrixSeed or CSC_H5ADMatrixSeed or CSR_H5ADMatrixSeed)
of shape #variables x #observations.
H5ADMatrixSeed vs H5ADMatrix objects
In order to have access to the full set of operations that are available
for DelayedMatrix objects, an H5ADMatrixSeed
derivative first needs to be wrapped in a DelayedMatrix
object, typically by calling the DelayedArray()
constructor on it.
This is what the H5ADMatrix()
constructor function does.
Note that the result of this wrapping is an H5ADMatrix object, which is just an H5ADMatrixSeed derivative wrapped in a DelayedMatrix object.
References
https://anndata.readthedocs.io/ for AnnData Python objects
and the h5ad
format.
See also
H5ADMatrix objects.
HDF5ArraySeed and H5SparseMatrixSeed objects.
readH5AD
andwriteH5AD
in the zellkonverter package for importing/exporting anh5ad
file as/from a SingleCellExperiment object.
Examples
library(zellkonverter)
h5ad_file <- system.file("extdata", "krumsiek11.h5ad",
package="zellkonverter")
seed <- H5ADMatrixSeed(h5ad_file)
seed
#> An object of class "Dense_H5ADMatrixSeed"
#> Slot "dimnames":
#> [[1]]
#> [1] "Gata2" "Gata1" "Fog1" "EKLF" "Fli1" "SCL" "Cebpa" "Pu.1"
#> [9] "cJun" "EgrNab" "Gfi1"
#>
#> [[2]]
#> [1] "0" "1" "2" "3" "4" "5" "6" "7" "8"
#> [10] "9" "10" "11" "12" "13" "14" "15" "16" "17"
#> [19] "18" "19" "20" "21" "22" "23" "24" "25" "26"
#> [28] "27" "28" "29" "30" "31" "32" "33" "34" "35"
#> [37] "36" "37" "38" "39" "40" "41" "42" "43" "44"
#> [46] "45" "46" "47" "48" "49" "50" "51" "52" "53"
#> [55] "54" "55" "56" "57" "58" "59" "60" "61" "62"
#> [64] "63" "64" "65" "66" "67" "68" "69" "70" "71"
#> [73] "72" "73" "74" "75" "76" "77" "78" "79" "80"
#> [82] "81" "82" "83" "84" "85" "86" "87" "88" "89"
#> [91] "90" "91" "92" "93" "94" "95" "96" "97" "98"
#> [100] "99" "100" "101" "102" "103" "104" "105" "106" "107"
#> [109] "108" "109" "110" "111" "112" "113" "114" "115" "116"
#> [118] "117" "118" "119" "120" "121" "122" "123" "124" "125"
#> [127] "126" "127" "128" "129" "130" "131" "132" "133" "134"
#> [136] "135" "136" "137" "138" "139" "140" "141" "142" "143"
#> [145] "144" "145" "146" "147" "148" "149" "150" "151" "152"
#> [154] "153" "154" "155" "156" "157" "158" "159" "0-1" "1-1"
#> [163] "2-1" "3-1" "4-1" "5-1" "6-1" "7-1" "8-1" "9-1" "10-1"
#> [172] "11-1" "12-1" "13-1" "14-1" "15-1" "16-1" "17-1" "18-1" "19-1"
#> [181] "20-1" "21-1" "22-1" "23-1" "24-1" "25-1" "26-1" "27-1" "28-1"
#> [190] "29-1" "30-1" "31-1" "32-1" "33-1" "34-1" "35-1" "36-1" "37-1"
#> [199] "38-1" "39-1" "40-1" "41-1" "42-1" "43-1" "44-1" "45-1" "46-1"
#> [208] "47-1" "48-1" "49-1" "50-1" "51-1" "52-1" "53-1" "54-1" "55-1"
#> [217] "56-1" "57-1" "58-1" "59-1" "60-1" "61-1" "62-1" "63-1" "64-1"
#> [226] "65-1" "66-1" "67-1" "68-1" "69-1" "70-1" "71-1" "72-1" "73-1"
#> [235] "74-1" "75-1" "76-1" "77-1" "78-1" "79-1" "80-1" "81-1" "82-1"
#> [244] "83-1" "84-1" "85-1" "86-1" "87-1" "88-1" "89-1" "90-1" "91-1"
#> [253] "92-1" "93-1" "94-1" "95-1" "96-1" "97-1" "98-1" "99-1" "100-1"
#> [262] "101-1" "102-1" "103-1" "104-1" "105-1" "106-1" "107-1" "108-1" "109-1"
#> [271] "110-1" "111-1" "112-1" "113-1" "114-1" "115-1" "116-1" "117-1" "118-1"
#> [280] "119-1" "120-1" "121-1" "122-1" "123-1" "124-1" "125-1" "126-1" "127-1"
#> [289] "128-1" "129-1" "130-1" "131-1" "132-1" "133-1" "134-1" "135-1" "136-1"
#> [298] "137-1" "138-1" "139-1" "140-1" "141-1" "142-1" "143-1" "144-1" "145-1"
#> [307] "146-1" "147-1" "148-1" "149-1" "150-1" "151-1" "152-1" "153-1" "154-1"
#> [316] "155-1" "156-1" "157-1" "158-1" "159-1" "0-2" "1-2" "2-2" "3-2"
#> [325] "4-2" "5-2" "6-2" "7-2" "8-2" "9-2" "10-2" "11-2" "12-2"
#> [334] "13-2" "14-2" "15-2" "16-2" "17-2" "18-2" "19-2" "20-2" "21-2"
#> [343] "22-2" "23-2" "24-2" "25-2" "26-2" "27-2" "28-2" "29-2" "30-2"
#> [352] "31-2" "32-2" "33-2" "34-2" "35-2" "36-2" "37-2" "38-2" "39-2"
#> [361] "40-2" "41-2" "42-2" "43-2" "44-2" "45-2" "46-2" "47-2" "48-2"
#> [370] "49-2" "50-2" "51-2" "52-2" "53-2" "54-2" "55-2" "56-2" "57-2"
#> [379] "58-2" "59-2" "60-2" "61-2" "62-2" "63-2" "64-2" "65-2" "66-2"
#> [388] "67-2" "68-2" "69-2" "70-2" "71-2" "72-2" "73-2" "74-2" "75-2"
#> [397] "76-2" "77-2" "78-2" "79-2" "80-2" "81-2" "82-2" "83-2" "84-2"
#> [406] "85-2" "86-2" "87-2" "88-2" "89-2" "90-2" "91-2" "92-2" "93-2"
#> [415] "94-2" "95-2" "96-2" "97-2" "98-2" "99-2" "100-2" "101-2" "102-2"
#> [424] "103-2" "104-2" "105-2" "106-2" "107-2" "108-2" "109-2" "110-2" "111-2"
#> [433] "112-2" "113-2" "114-2" "115-2" "116-2" "117-2" "118-2" "119-2" "120-2"
#> [442] "121-2" "122-2" "123-2" "124-2" "125-2" "126-2" "127-2" "128-2" "129-2"
#> [451] "130-2" "131-2" "132-2" "133-2" "134-2" "135-2" "136-2" "137-2" "138-2"
#> [460] "139-2" "140-2" "141-2" "142-2" "143-2" "144-2" "145-2" "146-2" "147-2"
#> [469] "148-2" "149-2" "150-2" "151-2" "152-2" "153-2" "154-2" "155-2" "156-2"
#> [478] "157-2" "158-2" "159-2" "0-3" "1-3" "2-3" "3-3" "4-3" "5-3"
#> [487] "6-3" "7-3" "8-3" "9-3" "10-3" "11-3" "12-3" "13-3" "14-3"
#> [496] "15-3" "16-3" "17-3" "18-3" "19-3" "20-3" "21-3" "22-3" "23-3"
#> [505] "24-3" "25-3" "26-3" "27-3" "28-3" "29-3" "30-3" "31-3" "32-3"
#> [514] "33-3" "34-3" "35-3" "36-3" "37-3" "38-3" "39-3" "40-3" "41-3"
#> [523] "42-3" "43-3" "44-3" "45-3" "46-3" "47-3" "48-3" "49-3" "50-3"
#> [532] "51-3" "52-3" "53-3" "54-3" "55-3" "56-3" "57-3" "58-3" "59-3"
#> [541] "60-3" "61-3" "62-3" "63-3" "64-3" "65-3" "66-3" "67-3" "68-3"
#> [550] "69-3" "70-3" "71-3" "72-3" "73-3" "74-3" "75-3" "76-3" "77-3"
#> [559] "78-3" "79-3" "80-3" "81-3" "82-3" "83-3" "84-3" "85-3" "86-3"
#> [568] "87-3" "88-3" "89-3" "90-3" "91-3" "92-3" "93-3" "94-3" "95-3"
#> [577] "96-3" "97-3" "98-3" "99-3" "100-3" "101-3" "102-3" "103-3" "104-3"
#> [586] "105-3" "106-3" "107-3" "108-3" "109-3" "110-3" "111-3" "112-3" "113-3"
#> [595] "114-3" "115-3" "116-3" "117-3" "118-3" "119-3" "120-3" "121-3" "122-3"
#> [604] "123-3" "124-3" "125-3" "126-3" "127-3" "128-3" "129-3" "130-3" "131-3"
#> [613] "132-3" "133-3" "134-3" "135-3" "136-3" "137-3" "138-3" "139-3" "140-3"
#> [622] "141-3" "142-3" "143-3" "144-3" "145-3" "146-3" "147-3" "148-3" "149-3"
#> [631] "150-3" "151-3" "152-3" "153-3" "154-3" "155-3" "156-3" "157-3" "158-3"
#> [640] "159-3"
#>
#>
#> Slot "filepath":
#> [1] "/usr/local/lib/R/site-library/zellkonverter/extdata/krumsiek11.h5ad"
#>
#> Slot "name":
#> [1] "/X"
#>
#> Slot "as_sparse":
#> [1] FALSE
#>
#> Slot "type":
#> [1] NA
#>
#> Slot "dim":
#> [1] 11 640
#>
#> Slot "chunkdim":
#> NULL
#>
#> Slot "first_val":
#> [1] 0.8032
#>
path(seed)
#> [1] "/usr/local/lib/R/site-library/zellkonverter/extdata/krumsiek11.h5ad"
dim(seed)
#> [1] 11 640
is_sparse(seed)
#> [1] FALSE
DelayedArray(seed)
#> <11 x 640> H5ADMatrix object of type "double":
#> 0 1 2 ... 158-3 159-3
#> Gata2 0.8032 0.7239 0.6578 . 0.0063 0.0049
#> Gata1 -0.0005 0.0016 0.0013 . -0.0023 0.0002
#> Fog1 -0.0001 -0.0003 -0.0010 . -0.0005 -0.0013
#> EKLF 0.0003 -0.0010 -0.0027 . 0.0081 0.0054
#> Fli1 0.0013 0.0011 0.0025 . -0.0046 -0.0036
#> SCL 0.0011 0.0022 0.0011 . -0.0006 0.0009
#> Cebpa 0.7997 0.8195 0.8358 . 0.9983 1.0011
#> Pu.1 0.8017 0.7256 0.6624 . 0.9970 0.9967
#> cJun 0.0006 0.0784 0.1105 . 0.0109 0.0066
#> EgrNab 0.0009 0.0077 0.0239 . -0.0030 -0.0033
#> Gfi1 0.0002 0.0941 0.1497 . 0.9118 0.9177
stopifnot(class(DelayedArray(seed)) == "H5ADMatrix")