zhoux85 / STAligner

STAligner is a tool for alignment and integration of spatially resolved transcriptomics data.
MIT License
29 stars 5 forks source link

Where is the count matrix and genetic information stored? #9

Open yanglq-bioinfo opened 1 year ago

yanglq-bioinfo commented 1 year ago

Hi,

I successfully ran the software and got the end result, But when I looked at the data structure I found that it was not the same as the regular adata structure of the scanpy, adata.var is supposed to be a dataframe structure, and I can get all the gene ids and other information, but these I don't find in the STAligner results,So I can't calculate various metrics such as mitochondrial ratios either, and I'd like to know where exactly these results are stored and how I can access them

zhoux85 commented 1 year ago

Hi. The var information is lost after the function ad.concat(Batch_list, label="slice_name", keys=section_ids). I suggest to replace the adata_concat var with original adata var: adata.var_names_make_unique(join="++") adata_concat.var = adata.var.loc[adata_concat.var_names.values]

yanglq-bioinfo commented 1 year ago

Hi. The var information is lost after the function ad.concat(Batch_list, label="slice_name", keys=section_ids). I suggest to replace the adata_concat var with original adata var: adata.var_names_make_unique(join="++") adata_concat.var = adata.var.loc[adata_concat.var_names.values]

Thank you for your reply. but I have some questions:

  1. When to run adata_concat.var = adata.var.loc[adata_concat.var_names.values] ?after running ad.concat? I found a solution on the internet I don't know if it's correct or not, Add a merge="same" in ad.concat
  2. I wanted to keep the original count matrix in adata.raw, how I can do it
zhoux85 commented 1 year ago

Hi.

  1. Run adata_concat.var = adata.var.loc[adata_concat.var_names.values] after running ad.concat.
  2. You can keep the original count matrix by adata.raw = adata.copy()
yanglq-bioinfo commented 1 year ago

Hi.

  1. Run adata_concat.var = adata.var.loc[adata_concat.var_names.values] after running ad.concat.
  2. You can keep the original count matrix by adata.raw = adata.copy()

Thanks!