AnnDataHelpers: AnnData Helpers

Description Usage Arguments Examples

Description

AnnData Helpers

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## S3 method for class 'AnnDataR6'
dimnames(x)

## S3 method for class 'AnnDataR6'
dim(x)

## S3 method for class 'AnnDataR6'
as.data.frame(x, row.names = NULL, optional = FALSE, layer = NULL, ...)

## S3 method for class 'AnnDataR6'
as.matrix(x, layer = NULL, ...)

## S3 method for class 'AnnDataR6'
r_to_py(x, convert = FALSE)

## S3 method for class 'anndata._core.anndata.AnnData'
py_to_r(x)

## S3 method for class 'AnnDataR6'
x[oidx, vidx]

## S3 method for class 'AnnDataR6'
t(x)

Arguments

x

An AnnData object.

row.names

Not used.

optional

Not used.

layer

An AnnData layer. If NULL, will use ad$X, otherwise ad$layers[layer].

...

Parameters passed to the underlying function.

convert

Not used.

oidx

Observation indices

vidx

Variable indices

Examples

 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
## Not run: 
ad <- AnnData(
  X = matrix(c(0, 1, 2, 3, 4, 5), nrow = 2),
  obs = data.frame(group = c("a", "b"), row.names = c("s1", "s2")),
  var = data.frame(type = c(1L, 2L, 3L), row.names = c("var1", "var2", "var3")),
  layers = list(
    spliced = matrix(c(4, 5, 6, 7, 8, 9), nrow = 2),
    unspliced = matrix(c(8, 9, 10, 11, 12, 13), nrow = 2)
  ),
  obsm = list(
    ones = matrix(rep(1L, 10), nrow = 2),
    rand = matrix(rnorm(6), nrow = 2),
    zeros = matrix(rep(0L, 10), nrow = 2)
  ),
  varm = list(
    ones = matrix(rep(1L, 12), nrow = 3),
    rand = matrix(rnorm(6), nrow = 3),
    zeros = matrix(rep(0L, 12), nrow = 3)
  ),
  uns = list(a = 1, b = 2, c = list(c.a = 3, c.b = 4))
)

dimnames(ad)
dim(ad)
as.data.frame(ad)
as.data.frame(ad, layer = "unspliced")
as.matrix(ad)
as.matrix(ad, layer = "unspliced")
ad[2,,drop=FALSE]
ad[,-1]
ad[,c("var1", "var2")]

## End(Not run)

anndata documentation built on Sept. 10, 2021, 5:07 p.m.