novae.data.AnnDataTorch
novae.data.AnnDataTorch
Source code in novae/data/convert.py
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 105 106 107 108 109 110 |
|
__getitem__(item)
Get the expression values for a subset of cells (corresponding to a subgraph).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
tuple[int, slice]
|
A |
required |
Returns:
Type | Description |
---|---|
tuple[Tensor, Tensor]
|
A |
Source code in novae/data/convert.py
__init__(adatas, cell_embedder)
Converting AnnData objects to PyTorch tensors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adatas |
list[AnnData]
|
A list of |
required |
cell_embedder |
CellEmbedder
|
A novae.module.CellEmbedder object. |
required |
Source code in novae/data/convert.py
to_tensor(adata)
Get the normalized gene expressions of the cells in the dataset. Only the genes of interest are kept (known genes and highly variable).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData
|
An |
required |
Returns:
Type | Description |
---|---|
Tensor
|
A |