MCPcopy Create free account
hub / github.com/SingleRust/SingleRust / read_h5ad

Function read_h5ad

src/io/mod.rs:12–26  ·  view source on GitHub ↗
(
    path_to_file: P,
    scope: FileScope,
    enable_cache: bool,
)

Source from the content-addressed store, hash-verified

10}
11
12pub fn read_h5ad<P: AsRef<Path>>(
13 path_to_file: P,
14 scope: FileScope,
15 enable_cache: bool,
16) -> anyhow::Result<AnnData<H5>> {
17 let h5_file = match scope {
18 FileScope::Read => H5::open(path_to_file)?,
19 FileScope::ReadWrite => H5::open_rw(path_to_file)?,
20 };
21 let adata = AnnData::<H5>::open(h5_file)?;
22 if enable_cache {
23 adata.get_x().inner().enable_cache();
24 }
25 Ok(adata)
26}
27
28pub fn read_h5ad_memory<P: AsRef<Path>>(path_to_file: P) -> anyhow::Result<IMAnnData> {
29 let adata = read_h5ad(path_to_file, FileScope::Read, false)?;

Callers 1

read_h5ad_memoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected