-
Notifications
You must be signed in to change notification settings - Fork 12
Trying to get CsrMatrix from AnnData #2
Copy link
Copy link
Open
Description
Hi Kai,
I'm trying to read CSR from a .h5ad file in Rust. It works with anndata. I'm using the Git versions from this repo.
I'm doing something like this:
let file = H5::open(path)?;
let adata = AnnData::<H5>::open(file)?;
let slot = adata.get_x();
let mut inner = slot.extract().unwrap();
println!("{}", inner.dtype());
println!("{}", inner.shape());
let data = inner.data::<CsrMatrix<f32>>()?;
println!("{:?}", data);CsrMatrix(f32)
54220 x 20845
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SparseFormatError { kind: InvalidStructure, error: "Column indices are not monotonically increasing (sorted) within each row." }'
InnerArrayElem requires specifying type D. Is it possible that I'm missing a step before getting the CsrMatrix?
Thanks in advance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels