# SDAS输入数据格式描述

用户可以**直接使用SAW**生成的单片或多片空间转录组表达矩阵，也可以按照如下h5ad和rds格式说明**自行准备文件**，作为SDAS的输入。更多细节格式描述可参考各模块使用说明。

## h5ad文件：为anndata对象&#x20;

1. **原始表达矩阵:** 可存在adata.layers（在SDAS命令行中通过--layer参数来指定key）， 或者存在adata.raw\.X, adata.X&#x20;
2. **基因名**（即gene symbol）：可存在adata.var\["real\_gene\_name"]，或adata.var的其他列（在SDAS命令行中通过--gene\_symbol\_key来指定key）
3. **空间坐标**（x,y） ：存在adata.obsm\["spatial"] ，用于scanpy.pl.spatial()绘制空间图或者参与空间距离计算。坐标系需符合SAW软件的标准输出格式，单位为时空芯片的像素。

   空间坐标示例（Stereo-seq数据，bin100分辨率）：

   ```python
   print(adata.obsm["spatial"])
   # 输出格式：[x坐标, y坐标]
   [[100 7900]    # 第一个空间点的坐标
   [100 8000]     # 第二个空间点的坐标
   [100 8100]     # 第三个空间点的坐标
   ...
   [20200 18800]  # 倒数第三个空间点的坐标
   [20200 18900]  # 倒数第二个空间点的坐标
   [20200 19000]] # 最后一个空间点的坐标
   ```

## rds文件： 为Seurat v4 assay对象&#x20;

1. **原始表达矩阵**: 存在默认assay的counts中(如@assays$RNA\@counts)，或者在SDAS中通过--assay指定assay名&#x20;
2. **基因名**（即gene symbol）： 可存在meta.features\[“real\_gene\_name”]，或meta.features的其他列（在SDAS中通过--gene\_symbol\_key来指定key）&#x20;
3. **空间坐标**（x,y）：存在@reductions$spatial中，用于FeaturePlot(reduction=“spatial”），DimPlot(reduction = “spatial”) 画空间图


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mysite.gitbook.io/sdas_manual_cn/readme/04_manual/sdas_input.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
