You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the great work! The tutorial gives an example on how to convert h5 to h5ad.
#Read original 10x_h5 data and save it to h5ad
from scanpy import read_10x_h5
adata = read_10x_h5("../tutorial/data/151673/expression_matrix.h5")
spatial=pd.read_csv("../tutorial/data/151673/positions.txt",sep=",",header=None,na_filter=False,index_col=0)
adata.obs["x1"]=spatial[1]
adata.obs["x2"]=spatial[2]
adata.obs["x3"]=spatial[3]
adata.obs["x4"]=spatial[4]
adata.obs["x5"]=spatial[5]
#Select captured samples
adata=adata[adata.obs["x1"]==1]
adata.var_names=[i.upper() for i in list(adata.var_names)]
adata.var["genename"]=adata.var.index.astype("str")
adata.write_h5ad("../tutorial/data/151673/sample_data.h5ad")
However, the data ['pixel_x', 'pixel_y', "array_x", "array_y"] are not created with read_10x_h5 by default.
Should the following code be added or to replace x2-x5 above?
#Read original 10x_h5 data and save it to h5ad
from scanpy import read_10x_h5
adata = read_10x_h5("path/filtered_feature_bc_matrix.h5")
spatial=pd.read_csv("path/spatial/tissue_positions_list.csv",
sep=",",header=None,na_filter=False,index_col=0)
adata.obs["Sample"]=spatial[1]
adata.obs["array_x"]=spatial[2]
adata.obs["array_y"]=spatial[3]
adata.obs["pixel_x"]=spatial[4]
adata.obs["pixel_y"]=spatial[5]
#Select captured samples
adata=adata[adata.obs["Sample"]==1]
adata.var_names=[i.upper() for i in list(adata.var_names)]
adata.var["genename"]=adata.var.index.astype("str")
adata.write_h5ad("Spatial.h5ad")
Thanks for the great work! The tutorial gives an example on how to convert h5 to h5ad.
However, the data
['pixel_x', 'pixel_y', "array_x", "array_y"]
are not created withread_10x_h5
by default.Should the following code be added or to replace x2-x5 above?
Also, I cannot find the pkl files in the results folder, nor in download data/results files, for
7.1 Read in cell type annotations
.FileNotFoundError: [Errno 2] No such file or directory: './results/B_annotation_c_d.pkl'
did I miss anything?
The text was updated successfully, but these errors were encountered: