galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.39k stars 999 forks source link

H5 data assertion in tool wrapping #18767

Closed nilchia closed 1 month ago

nilchia commented 1 month ago

Bug in H5 data assertion for h5ad files

I tried to use has_h5_attribute and has_h5_keys to assert scanpy outputs (here)

This assertion has the same problem as the h5ad metadata (Which was fixed here).

for example:

<output name="anndata_out" ftype="h5ad">
    <assert_contents>
        <has_h5_keys keys="X,layers,obs,obsm,obsp,uns,var,varm,varp"/>
        <has_h5_attribute key="obs" value="louvain"/>
        <has_h5_attribute key="uns" value="louvain"/>
    </assert_contents>
</output>

fails with this error:

Not a HDF5 file or H5 attributes do not match:
    [('encoding-type', 'anndata'), ('encoding-version', '0.1.0')]

    (obs : louvain)
nilchia commented 1 month ago

This works: <has_h5_keys keys="obsm/X_PCA" />