Files
brapi-java/docs/dev/03-genotyping/11-linkage_group.md
2026-05-28 11:56:17 +08:00

43 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 03 Genotyping - linkageGroup / linkage_group 表录入说明
来源:`docs/architecture/03-genotyping-data-flow.md`
## 命名注意
架构文档标注 `LinkageGroupEntity` 对应表名是驼峰 `linkageGroup`。当前初始 schema DDL 中实际表名为 `linkage_group`。做 Atlas/Flyway 迁移时,必须先确认目标数据库中的真实表名,避免生成大小写或命名不一致的重复表。
## 录入目标
连锁群是 genome_map 下的分组,例如 chromosome 或 linkage group。`marker_position` 会把 variant 放到具体 linkage group 的位置上。
## 上下游关系
| 类型 | 内容 |
| --- | --- |
| Java 实体 | `LinkageGroupEntity` |
| 表 | 架构文档:`linkageGroup`;当前 DDL`linkage_group` |
| 前置依赖 | `genome_map` |
| 下游引用 | `marker_position` |
## 字段录入
| 字段 | 业务意义 | 录入方式 | 校验规则 |
| --- | --- | --- | --- |
| `id` | linkage group 主键 | 系统生成;导入时可指定 | 必填、唯一 |
| `auth_user_id` | 数据所属用户 | 登录上下文自动写入 | 不允许前端手填 |
| `genome_map_id` | 所属 genome_map | GenomeMap 选择器 | 必选,必须存在 |
| `linkage_group_name` | 连锁群名称 | 用户录入/导入 | 建议必填,同一 map 下唯一 |
| `max_marker_position` | 最大 marker 位置 | 数字输入/导入 | 可选,非负 |
## 页面与交互
- 通常作为 GenomeMap 详情页的子表维护。
- 支持批量导入 linkage group。
- 详情页展示该 linkage group 下的 marker_position 列表。
## 关键校验
1. `genome_map_id` 必须存在。
2. 同一 genome_map 下 `linkage_group_name` 不应重复。
3. 删除 linkage group 前检查 `marker_position` 引用。