File: ReshapedHDF5Array-class.Rd

package info (click to toggle)
r-bioc-hdf5array 1.34.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,736 kB
  • sloc: ansic: 5,815; makefile: 4
file content (104 lines) | stat: -rw-r--r-- 3,203 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
\name{ReshapedHDF5Array-class}
\docType{class}

\alias{class:ReshapedHDF5Array}
\alias{ReshapedHDF5Array-class}
\alias{ReshapedHDF5Array}

\alias{DelayedArray,ReshapedHDF5ArraySeed-method}

\alias{class:ReshapedHDF5Matrix}
\alias{ReshapedHDF5Matrix-class}
\alias{ReshapedHDF5Matrix}

\alias{matrixClass,ReshapedHDF5Array-method}
\alias{coerce,ReshapedHDF5Array,ReshapedHDF5Matrix-method}
\alias{coerce,ReshapedHDF5Matrix,ReshapedHDF5Array-method}
\alias{coerce,ANY,ReshapedHDF5Matrix-method}

\title{Virtually reshaped HDF5 datasets as DelayedArray objects}

\description{
  The ReshapedHDF5Array class is a \link[DelayedArray]{DelayedArray}
  subclass for representing an HDF5 dataset with a user-supplied upfront
  virtual reshaping.

  All the operations available for \link[DelayedArray]{DelayedArray}
  objects work on ReshapedHDF5Array objects.
}

\usage{
## Constructor function:
ReshapedHDF5Array(filepath, name, dim, type=NA)
}

\arguments{
  \item{filepath, name, type}{
    See \code{?\link{HDF5Array}} for a description of these arguments.
  }
  \item{dim}{
    A vector of dimensions that describes the virtual reshaping i.e.
    the reshaping that is virtually applied upfront to the HDF5 dataset
    when the ReshapedHDF5Array object gets constructed.

    Note that the HDF5 dataset is treated as read-only so is not
    \emph{effectively} reshaped, that is, the dataset dimensions encoded
    in the HDF5 file are not mmodified.

    Also please note that arbitrary reshapings are not supported.
    Only reshapings that reduce the number of dimensions by collapsing
    a group of consecutive dimensions into a single dimension are supported.
    For example, reshaping a 10 x 3 x 5 x 1000 array as a 10 x 15 x 1000
    array or as a 150 x 1000 matrix is supported.
  }
}

\value{
  A ReshapedHDF5Array (or ReshapedHDF5Matrix) object. (Note that
  ReshapedHDF5Matrix extends ReshapedHDF5Array.)
}

\seealso{
  \itemize{
    \item \link{HDF5Array} objects for representing HDF5 datasets as
          \link[DelayedArray]{DelayedArray} objects without upfront
          virtual reshaping.

    \item \link[DelayedArray]{DelayedArray} objects in the \pkg{DelayedArray}
          package.

    \item \code{\link{writeHDF5Array}} for writing an array-like object
          to an HDF5 file.

    \item \code{\link{saveHDF5SummarizedExperiment}} and
          \code{\link{loadHDF5SummarizedExperiment}} in this
          package (the \pkg{HDF5Array} package) for saving/loading
          an HDF5-based \link[SummarizedExperiment]{SummarizedExperiment}
          object to/from disk.

    \item The \link{ReshapedHDF5ArraySeed} helper class.

    \item \code{\link{h5ls}} to list the content of an HDF5 file.
  }
}

\examples{
library(h5vcData)
tally_file <- system.file("extdata", "example.tally.hfs5",
                          package="h5vcData")
h5ls(tally_file)

## Pick up "Coverages" dataset for Human chromosome 16 and collapse its
## first 2 dimensions:
cvg <- ReshapedHDF5Array(tally_file, "/ExampleStudy/16/Coverages",
                         dim=c(12, 90354753))
cvg

is(cvg, "DelayedArray")  # TRUE
seed(cvg)
path(cvg)
dim(cvg)
chunkdim(cvg)
}
\keyword{classes}
\keyword{methods}