modified: Makefile
[GalaxyCodeBases.git] / python / salus / cmplatform / h5ad.py
blobb113dcaae6f04aa1bec4fef68f48d99b8c05060b
1 #!/usr/bin/env python3
3 import squidpy as sq
4 import os
6 prefix='/share/result/spatial/data/BoAo_sp/sub2/'
7 outpath='/share/result/spatial/data/BoAo_sp/sub2/h5ad/'
8 items=['srp_Illumina_mbrain', 'srp_Illumina_mkidney', 'srp_Salus_mbrain', 'srp_Salus_mkidney']
10 for ids in items:
11 visiumPath = os.path.join( prefix,ids,'outs' )
12 outfile = os.path.join( outpath,ids+'.rsp.h5ad' )
13 print(f"{visiumPath}, {outfile}")
14 adata=sq.read.visium(visiumPath, library_id=ids)
15 adata.var_names_make_unique()
16 adata.write_h5ad(outfile,compression='lzf')