Expand description
Build a backend from the formats single-cell tools write.
from_mtx: a MatrixMarket file with its feature and barcode TSVs, such as a 10x Cell Ranger MEX triplet (MtxImport).- [
from_h5ad] (featurehdf5): an AnnData.h5adfile ([H5adImport]), itsobswritten beside the backend as{stem}.cell_metadata.tsv.gz. - [
from_10x_matrix] (featurehdf5): a Cell Ranger feature-barcode matrix.h5([TenxMatrixImport]). - [
from_10x_molecule] (featurehdf5): a Cell Rangermolecule_info.h5, counted as Cell Ranger counts it ([TenxMoleculeImport]).
Each writes the backend Output names, squeezed when it asks, and
returns the path of the file written: {output}.zarr.zip by default. The
stage_* functions stop short of the last step and return a Staged
build, for a caller that looks at the backend before keeping it (as the
CLI’s import preview does). These are what data-beans from-mtx,
from-h5ad, from-10x-matrix and from-10x-molecule run.
use data_beans::import::{self, MtxImport, Output};
let mtx = MtxImport {
row: Some("filtered/features.tsv.gz".into()),
col: Some("filtered/barcodes.tsv.gz".into()),
..MtxImport::new("filtered/matrix.mtx.gz")
};
let backend = import::from_mtx(&mtx, &Output::new("pbmc"))?; // "pbmc.zarr.zip"
#[cfg(feature = "hdf5")]
let backend = import::from_h5ad(&import::H5adImport::new("pbmc.h5ad"), &Output::new("pbmc"))?;Structs§
- MtxImport
- A MatrixMarket matrix and its name files, as
from_mtxreads them. - Output
- Where an import writes its backend.
- Squeeze
- A squeeze: the rows and columns with fewer non-zeros than these go.
- Staged
- A backend written but not yet in place: for a
.zarr.zipoutput, the.zarrdirectory it is zipped from.finishputs it in place;discarddeletes it.