writeH5AD | R Documentation |
Create an H5AD file from a liger object. This function writes
only raw counts to adata.X
, while normalized and scaled expression
data will not be written, because LIGER use different normalization and
scaling strategy than most of the other tools utilizing H5AD format.
Supports for single sparse matrices or internal ligerDataset objects are also provided if there is a need to convert single datasets.
writeH5AD(object, ...)
## S3 method for class 'dgCMatrix'
writeH5AD(
object,
filename,
obs = NULL,
var = NULL,
overwrite = FALSE,
verbose = getOption("ligerVerbose", TRUE),
...
)
## S3 method for class 'ligerDataset'
writeH5AD(
object,
filename,
obs = NULL,
overwrite = FALSE,
verbose = getOption("ligerVerbose", TRUE),
...
)
## S3 method for class 'liger'
writeH5AD(
object,
filename,
overwrite = FALSE,
verbose = getOption("ligerVerbose", TRUE),
...
)
object |
One of liger, ligerDataset or dgCMatrix-class object. |
... |
Arguments passed down to S3 methods |
filename |
A character string, the path to the H5AD file to be written |
obs |
External data.frame that contains metadata of the cells but does not embed inside the object. Rownames must be identical to the colnames of object. |
var |
External data.frame that contains metadata of the features but does not embed inside the object. Rownames must be identical to the rownames of object. |
overwrite |
Logical, whether to overwrite the file if it exists. |
verbose |
Logical. Whether to show information of the progress. Default
|
No return value, an H5AD file is written to disk with the following
specification, assuming the file is loaded to adata
in Python:
adata.X
- Raw count CSR matrix, outer joined with all
datasets
adata.obs
- Cell metadata, with exactly same content of
cellMeta(object)
adata.var
- Feature metadata containing only the feature names
as the index of pd.DataFrame
.
adata.obsm['X_inmf_aligned']
- The integrated embedding,
aligned cell factor loading matrix, the primary output of LIGER, if
available.
adata.obsm['X_inmf']
- The raw cell factor loading matrix, if
available.
adata.obsm['<dimRedName>']
- The dimensional reduction matrix,
such as UMAP or TSNE, if available.
adata.uns['inmf']['W']
- The shared factor feature loading
matrix, if available.
adata.uns['inmf']['V']['<datasetName>']
- The dataset-specific
factor feature loading matrix, if available.
adata.uns['inmf']['features']
- The variable features being
used for factorization, supposed to match to the second shape of W and V,
if available.
adata.uns['inmf']['lambda']
- The hyperparameter lambda used,
the regularization parameter for the factorization, if available.
adata.uns['inmf']['k']
- The number of factors used for the
factorization, if available.
print("The example below works, but causes PDF manual rendering issue for some reason")
## Not run:
writeH5AD(pbmc, filename = tempfile(fileext = ".h5ad"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.