dsh-molbio-tools 0.27.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/README.md +39 -14
- package/benchmark/README.md +7 -7
- package/benchmark/_probe-v28.mjs +60 -0
- package/benchmark/tasks/10-v28.json +300 -0
- package/benchmark/verifications.mjs +49 -0
- package/cordis.patch.yml +2 -2
- package/docs/capability-gap-survey.md +1 -1
- package/docs/client-panel.md +2 -2
- package/docs/history.md +47 -0
- package/docs/maintainer.md +9 -6
- package/docs/roadmap.md +26 -4
- package/docs/v28-plan.md +227 -0
- package/docs/workflow.md +5 -5
- package/index.mjs +636 -2
- package/package.json +5 -2
- package/preset/molbio-lab/agent.cordis.yml +2 -2
- package/preset/molbio-lab/preset.yml +1 -1
- package/protein-annotate.mjs +525 -0
- package/sequence-ops.mjs +203 -0
- package/sequencing.mjs +517 -0
- package/test/contract.mjs +2 -2
- package/test/smoke.mjs +191 -2
- package/test/svgpng.mjs +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,88 @@
|
|
|
10
10
|
改为按**包名**引用后模块缓存问题随之消失——没有拷贝,也就没有需要保持同步的版本目录。
|
|
11
11
|
下文历史条目里出现的 `vN` 目录保持原样,作为当时的记录。
|
|
12
12
|
|
|
13
|
+
## [0.28.0] — 2026-11-26(蛋白注释 + 格式互操作 + 测序判读:survey #13/#14/#21/#10/#27/#31)
|
|
14
|
+
|
|
15
|
+
**工具数 65 → 72,benchmark 66 → 73 题(72/72 覆盖)。** 这一版把三条候选线一次做完:蛋白注释、
|
|
16
|
+
注释格式与序列编辑、Sanger 读段判读。上游没有可跟的版本(`0.2.3-alpha.2` 仍是 npm `alpha` 的最新,
|
|
17
|
+
`latest`/`next` 仍是 `0.2.2-rc.5`),所以这一版全部是工具行为,`dshReleases` / `engines` / preset 行清单
|
|
18
|
+
都没有改。
|
|
19
|
+
|
|
20
|
+
### 1. 蛋白注释(#13 / #21 / #14)
|
|
21
|
+
|
|
22
|
+
- **`molbio_protein_features`**(#13):PTM 基序扫描(N-糖基化 N-{P}-[S/T]、C-甘露糖基化 W-x-x-W、
|
|
23
|
+
N-端肉豆蔻酰化、SUMO 化 ψKxE、PKA R-R-x-[S/T]、CK2 [S/T]-x-x-[D/E]、脯氨酸导向 [S/T]-P)、
|
|
24
|
+
SEG 风格的熵窗口低复杂度区、芳香性与 Guruprasad 不稳定指数(>40 报 `unstable`)。
|
|
25
|
+
- **`molbio_signal_peptide`**(#21):von Heijne 1986 的 −13..+2 位置权重(真核 / 革兰阴性两套,
|
|
26
|
+
与 EMBOSS sigcleave 的 `log(count/expected)` 构造一致),给出最佳切割位点、信号肽、候选切割位点,
|
|
27
|
+
以及**与 `molbio_hydropathy_plot` 同一窗口/阈值**的候选跨膜段;附一张分数曲线 SVG。
|
|
28
|
+
只扫描 N 端前 50 个残基(`max_cleavage` 可调),避免把中段偶然高分读成信号肽。
|
|
29
|
+
- **`molbio_antigenicity`**(#14):Kolaskar–Tongaonkar 1990 的 7-mer A(p) 倾向,按“全蛋白均值 / 1.0”
|
|
30
|
+
选位点、连续 ≥6 个残基成区;同时报 Parker 亲水性、Emini 可及性与 Vihinen 柔性的**区间均值**,
|
|
31
|
+
不合成单一分数。
|
|
32
|
+
- **表格来源与验证**:DIWV(20×20)、Parker/Emini/Vihinen(各 20)转录自 Biopython 1.88
|
|
33
|
+
`ProtParamData.py`(BSD-3,Guruprasad 1990 的参考实现);A(p) 与两套信号肽计数转录自
|
|
34
|
+
EMBOSS 6.6.0 的 `data/Eantigenic.dat`、`data/Esig.euk`、`data/Esig.pro`。所有值都在源码注释里
|
|
35
|
+
注明出处,测试用可手算的已知值钉住(`AAAA` 的不稳定指数 7.5、20×A 的 A(p) 区间 4-17、
|
|
36
|
+
胰岛素原信号肽切割位点 24、绿色荧光蛋白片段不报信号肽)。
|
|
37
|
+
|
|
38
|
+
### 2. 注释格式与序列编辑(#10)
|
|
39
|
+
|
|
40
|
+
- **`molbio_feature_export`**:把 `.dna`/`.gb` 或内联序列 + features 导出为 **GFF3(1-based inclusive)**、
|
|
41
|
+
**BED(0-based half-open)**或 CSV,并在输出里写明用的是哪套坐标;`location` 原样保留,
|
|
42
|
+
多段特征按外边界导出并给出提示。**CDS phase 不计算**(没有建模转录本阅读框),列写 `.`,
|
|
43
|
+
而不是猜一个看起来合理的数。写文件仍走 `ctx.fs` + `sandboxPolicy`。
|
|
44
|
+
- **`molbio_sequence_edit`**:rotate / insert / delete / replace / split / join(可带精确 overlap 校验)。
|
|
45
|
+
坐标统一 1-based inclusive;`insert.position` / `split.position` 是“保留在前面的碱基数”。
|
|
46
|
+
**不重映射特征坐标**,输出里明确提示:编辑移动了注释就要重新导出。
|
|
47
|
+
|
|
48
|
+
### 3. Sanger 读段判读(#27 / #31)
|
|
49
|
+
|
|
50
|
+
- **`molbio_sanger_assemble`**(#27):1–24 条 `.ab1`/`.seq`/`.fasta` 或内联 reads 的贪心 overlap-layout
|
|
51
|
+
组装;每条读两种朝向都试,按“overlap − 2×mismatch”选最优;Phred 末端修剪;每次放置后用
|
|
52
|
+
**质量加权共识**重建 contig;报每条读的位置/朝向/overlap、覆盖度、冲突与未放置读;
|
|
53
|
+
可选精确 end-overlap 环化。文本写明它不是基因组组装器,也不合并 paired-end。
|
|
54
|
+
- **`molbio_editing_outcome`**(#31):每条读两向比对参考(环状参考按加倍处理),按**精确变异签名**
|
|
55
|
+
聚类成等位基因,报频率与 CDS 内的蛋白效应(wild_type / silent / missense / nonsense / frameshift /
|
|
56
|
+
in_frame_indel / outside_cds)。频率是**已比对 reads 的比例**,不是 TIDE 的峰分解。
|
|
57
|
+
**两条边界**:identity 之外还要求至少比对到读长的一半(最少 20 bp),否则一段偶然的短局部匹配
|
|
58
|
+
会被误收成等位基因;indel 的移码判定用**净长度变化**,所以被比对拆成两段的 3 bp 缺失仍判 in-frame。
|
|
59
|
+
|
|
60
|
+
### 4. 测试、benchmark 与守卫
|
|
61
|
+
|
|
62
|
+
- `test/smoke.mjs`:新增 7 个工具的已知值/边界/错误路径断言(基序正负例、低复杂度、截断、
|
|
63
|
+
信号肽阳性/阴性、跨膜段、A(p) 手算值、GFF3/BED/CSV 三套坐标、旋转/插入/删除/替换/拆分/合并、
|
|
64
|
+
三读组装与未放置读、四读等位基因聚类与 A2T/in-frame 判定);工具数断言 65 → 72。
|
|
65
|
+
- 图片工具 17 → 18(`molbio_signal_peptide`);`test/contract.mjs` 同步;`test/svgpng.mjs` 的
|
|
66
|
+
样本集加入信号肽曲线,仍然证明 `unsupported` / `missing_glyphs` 为空。
|
|
67
|
+
- benchmark:新增 `protein-features`、`signal-peptide`、`antigenicity`、`feature-export`、
|
|
68
|
+
`sequence-edit`、`sanger-assemble`、`editing-outcome` 七条 full 档任务(`tasks/10-v28.json`),
|
|
69
|
+
并加到 `benchmark/verifications.mjs`;`bench --offline` 73 题全绿,`benchmark-coverage` 72/72。
|
|
70
|
+
可复现的输入记录在 `benchmark/_probe-v28.mjs`。
|
|
71
|
+
- **首次真实模型跑后的可用性修正(editing-outcome)**:第一跑用了 10 次工具调用 / 107 s——模型把 96 bp
|
|
72
|
+
参考抄成了 93 bp 的 read,随后逐条重试、用 shell 核对长度、再用 `translate` 复核。据此把工具描述
|
|
73
|
+
改成“一次调用传全部 reads、`reference` 是完整分子而不是 CDS 或 read、不要在 shell/translate 里重算”,
|
|
74
|
+
并在结果里增加“没有任何 read 与参考完全一致”的诊断(全编辑样本也会触发,所以是提示而非报错)。
|
|
75
|
+
同题重跑:**27 s / 4 次调用 / 180,845 tokens,仍 PASS**。
|
|
76
|
+
- `test/benchmark-profile.mjs` 的 headless profile 现为 14 行 / 72 工具。
|
|
77
|
+
|
|
78
|
+
### 5. 文档与版本
|
|
79
|
+
|
|
80
|
+
- README 的工具表/计数、`preset.yml` 描述、`agent.cordis.yml` 注释、`cordis.patch.yml`(重新生成)、
|
|
81
|
+
`docs/maintainer.md`、`docs/roadmap.md`、`docs/capability-gap-survey.md` 同步到 72 工具 / 73 题。
|
|
82
|
+
- 根包 `0.27.1 → 0.28.0`;面板包保持 `0.1.17`:三个新模块只在宿主半,
|
|
83
|
+
`lib/client.js` 字节未变(与 0.27.0 因 `lib.mjs` 进浏览器半而 bump 的情形不同)。
|
|
84
|
+
|
|
85
|
+
### 6. 验收(本机 0.2.3-alpha.2 桌面版 `app.asar`)
|
|
86
|
+
|
|
87
|
+
- `smoke`(72 工具)、`svgpng`(23)、`svgio`、`charts`、`structure`、`client`、`panel-render`、
|
|
88
|
+
`map-card`、`client-mount`、`contract`(17)、`drift-probe`(17 个突变)、`preset-health`(31 行)、
|
|
89
|
+
`benchmark-profile`(72 工具)、`benchmark-score`、`benchmark-coverage`(72/72、73 题)、
|
|
90
|
+
`bench --offline`(73 题)全部通过。
|
|
91
|
+
- `test/release.mjs` **13 项全绿**(npm 11.20.0,满足可信发布下限 11.5.1);
|
|
92
|
+
`build/release-preflight.mjs --tag v0.28.0` 通过(根包 0.28.0 待发布,面板 0.1.17 已发布且字节一致)。
|
|
93
|
+
注意:npm 版本探测在 DSH 沙箱内会因管道捕获子进程而返回 `EPERM`,发布守卫应在沙箱外跑;
|
|
94
|
+
本版验收时已在沙箱外实跑。
|
|
13
95
|
## [0.27.1] — 2026-11-24(DSH 0.2.3-alpha.2 适配:面板改读 workingDirectory projection 并修正 workspaceFiles 首参、守卫换用 Include 解析器、preset 跟上游两行)
|
|
14
96
|
|
|
15
97
|
**工具数不变(65),benchmark 不变(66 题)。** 0.25.3 的验收基线是 **0.2.2-rc.5**;这一版把基线推到
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dsh-molbio-tools
|
|
2
2
|
|
|
3
|
-
**给 AI 助手装上分子生物学的"手"**:一个零依赖的 DeepSeek Harness 插件包,为它提供 **
|
|
3
|
+
**给 AI 助手装上分子生物学的"手"**:一个零依赖的 DeepSeek Harness 插件包,为它提供 **72 个
|
|
4
4
|
`molbio_*` 工具**——序列分析、引物/探针自动设计、克隆模拟、质粒图谱、测序验证、蛋白与 CRISPR
|
|
5
5
|
分析、qPCR 统计、文献与实验记录。装上之后,你可以直接用自然语言让助手完成这些计算,并把结果
|
|
6
6
|
画成图。
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
## 目录
|
|
32
32
|
|
|
33
33
|
- [安装](#安装)(3 步)
|
|
34
|
-
- [它会做什么](#它会做什么)(按任务分组的
|
|
34
|
+
- [它会做什么](#它会做什么)(按任务分组的 72 个工具)
|
|
35
35
|
- [典型用法示例](#典型用法示例)
|
|
36
36
|
- [输出文件、自动打开与浏览器面板](#输出文件自动打开与浏览器面板)
|
|
37
37
|
- [方法学与使用须知](#方法学与使用须知)(各工具的模型、估算范围与边界)
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
### 推荐:在 DSH 插件页安装(3 步)
|
|
48
48
|
|
|
49
|
-
装完后,预设选择器里会出现 **Molecular Biology Lab** 模式;**
|
|
49
|
+
装完后,预设选择器里会出现 **Molecular Biology Lab** 模式;**72 个工具只在这个模式里出现**,
|
|
50
50
|
不会污染你其它会话(这点很重要:工具多了会占提示预算)。**右栏的 Molbio / Papers 两个面板也随这个包
|
|
51
51
|
一起装好**,不需要再装 `dsh-molbio-panel`。
|
|
52
52
|
|
|
@@ -106,9 +106,9 @@ dsh plugin --profile web update dsh-molbio-tools
|
|
|
106
106
|
| 层(同一个 `cordis.patch.yml` 里的两段) | 作用 |
|
|
107
107
|
| --- | --- |
|
|
108
108
|
| `molbio-client` → `./host.mjs` | 只插一行**惰性宿主锚点**,不注册任何工具 |
|
|
109
|
-
| `preset-molbio-lab` → `@deepseek-ai/dsh-agent-preset` | 声明 **Molecular Biology Lab** 模式,
|
|
109
|
+
| `preset-molbio-lab` → `@deepseek-ai/dsh-agent-preset` | 声明 **Molecular Biology Lab** 模式,72 个工具在这一层里 |
|
|
110
110
|
|
|
111
|
-
所以
|
|
111
|
+
所以 72 个工具**只在选中该模式的会话里加载**,其它模式(standard / ptc / minimal / cordis)
|
|
112
112
|
不带它们,不占提示预算。bundle 安装 ≠ 工具全局可见:bundle 只是把"模式"和"面板"一起装进来。
|
|
113
113
|
|
|
114
114
|
> **那一行锚点不是多余的。** DSH 的客户端模块扫描只走**宿主 Loader 树**(官方原话:
|
|
@@ -124,7 +124,7 @@ dsh plugin --profile web update dsh-molbio-tools
|
|
|
124
124
|
|
|
125
125
|
### 只要浏览器面板
|
|
126
126
|
|
|
127
|
-
如果只想要图形面板、不想让该 profile 装
|
|
127
|
+
如果只想要图形面板、不想让该 profile 装 72 个工具(连模式都不装),装面板专用包即可
|
|
128
128
|
(见[浏览器面板](#浏览器面板可选))。**它和 `dsh-molbio-tools` 二选一**:两者注册同一组右栏 tab
|
|
129
129
|
(`dsh-molbio-tools` / `dsh-molbio-tools/papers`),同时装会重复注册并报
|
|
130
130
|
`tab type id ... is already registered`。同样在 **插件 → 添加插件** 里输入 `dsh-molbio-panel`,
|
|
@@ -140,10 +140,10 @@ dsh plugin --profile <profile> add dsh-molbio-panel
|
|
|
140
140
|
|
|
141
141
|
## 它会做什么
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
72 个工具按任务分为十组。下表是"你想做什么 → 用哪个工具"的索引,参数细节模型会在调用时自己
|
|
144
144
|
填;你只需要把意图说清楚。
|
|
145
145
|
|
|
146
|
-
### 1. 序列分析与酶切(
|
|
146
|
+
### 1. 序列分析与酶切(11)
|
|
147
147
|
|
|
148
148
|
| 工具 | 用途 |
|
|
149
149
|
| --- | --- |
|
|
@@ -156,8 +156,10 @@ dsh plugin --profile <profile> add dsh-molbio-panel
|
|
|
156
156
|
| `molbio_double_digest` | **双酶切规划**:两个酶各自的切点/片段、合并切点与片段,以及两者**是否共用 buffer**(无共用则提示顺序酶切或换用厂商双酶切 buffer) |
|
|
157
157
|
| `molbio_dotplot` | **序列自身 dotplot**:按 k-mer 精确匹配画直接重复(黑)与反向重复(红),网格分箱以限制文件大小,并报告匹配数与任何扫描/绘图截断;是精确 k-mer 视图,不是滑窗同一性打分图 |
|
|
158
158
|
| `molbio_contamination_screen` | **载体/接头污染筛查**:用内置的短签名表(pUC/pBR322、pUC19 lacZ/M13、pET T7、pcDNA CMV/BGH、Gateway attB1/attB2、Illumina/Nextera 接头)扫描序列或 FASTA/FASTQ;双链、默认精确、可选 0–2 错配,报告每个签名命中的 reads 数、示例位置/链/错配。**短签名筛查,不是 BLAST/全库比对;未命中不等于干净** |
|
|
159
|
+
| `molbio_feature_export` | **注释导出**:特征 → GFF3(1-based 闭区间)/ BED(0-based 半开)/ CSV,输出里写明用哪套坐标;多段特征按外边界导出并保留原 `location`;CDS phase 不建模,写 `.` |
|
|
160
|
+
| `molbio_sequence_edit` | **序列编辑**:rotate / insert / delete / replace / split / join(join 可校验精确 overlap);坐标 1-based 闭区间;**不重映射特征** |
|
|
159
161
|
|
|
160
|
-
### 2. 引物设计(
|
|
162
|
+
### 2. 引物设计(7)
|
|
161
163
|
|
|
162
164
|
| 工具 | 用途 |
|
|
163
165
|
| --- | --- |
|
|
@@ -190,7 +192,7 @@ dsh plugin --profile <profile> add dsh-molbio-panel
|
|
|
190
192
|
| `molbio_silent_site_mutagenesis` | **静默酶切位点突变**:在同义密码子范围内添加/移除限制性位点,保持蛋白序列不变;输出逐碱基变化、可直接喂给 `molbio_mutagenesis_primers` 的 mutation texts、突变后序列;只支持识别序列无简并碱基的酶 |
|
|
191
193
|
| `molbio_extract_region` | 从质粒文件按特征名(如 "AmpR"、"MCS")或坐标提取子序列,可选反向互补与存 FASTA |
|
|
192
194
|
|
|
193
|
-
### 5. 测序与实验数据(
|
|
195
|
+
### 5. 测序与实验数据(8)
|
|
194
196
|
|
|
195
197
|
| 工具 | 用途 |
|
|
196
198
|
| --- | --- |
|
|
@@ -200,8 +202,10 @@ dsh plugin --profile <profile> add dsh-molbio-panel
|
|
|
200
202
|
| `molbio_lab_math` | 稀释计算、摩尔浓度、DNA 拷贝数 |
|
|
201
203
|
| `molbio_plot` | **实验数据图表(8 种)**:柱状图(均值±SD 误差棒)、散点图(可选拟合线)、折线图(按分组列拆多条序列)、直方图(分箱默认 Freedman-Diaconis)、箱型图(Q1–Q3 箱 + 中位线 + 1.5×IQR 须 + 离群点)、**小提琴图**(高斯核密度轮廓 + 内部箱;看分布形状时用它)、**火山图**(log2FC × 显著性,带虚线阈值;**只画不检验**,p 值必须由表提供)、**热力图**(行×列矩阵,一格一色 + 色标;支持宽表与长表两种版式,`scale: row_zscore\|log2` 是**显式申报的展示变换**)。表类图表直接读工作区 **CSV/TSV**(`data_path` + `columns` 指名列),也可用 `data` 内联表格文本;结果里带回算好的统计量,**报数请引用它而不是照图估读** |
|
|
202
204
|
| `molbio_virtual_gel` | **虚拟琼脂糖凝胶**:给出预期片段大小 → SVG 凝胶图 + 分子量 ladder,和真胶对照 |
|
|
205
|
+
| `molbio_sanger_assemble` | **Sanger 读段组装**:1–24 条 `.ab1`/`.seq`/`.fasta` 的贪心 overlap-layout,双朝向、Phred 末端修剪、质量加权共识、覆盖度/冲突/未放置读,可选精确 end-overlap 环化 |
|
|
206
|
+
| `molbio_editing_outcome` | **编辑结果归类**:读段两向比对参考 → 按精确变异签名聚类 → 频率与 CDS 蛋白效应(silent/missense/nonsense/frameshift/in_frame_indel);频率是**已比对 reads** 的比例,不是 TIDE |
|
|
203
207
|
|
|
204
|
-
### 6. 蛋白质(
|
|
208
|
+
### 6. 蛋白质(9)
|
|
205
209
|
|
|
206
210
|
| 工具 | 用途 |
|
|
207
211
|
| --- | --- |
|
|
@@ -211,6 +215,9 @@ dsh plugin --profile <profile> add dsh-molbio-panel
|
|
|
211
215
|
| `molbio_codon_optimize` | E. coli/酵母/人密码子优化,可顺便避开指定酶切位点 |
|
|
212
216
|
| `molbio_helical_wheel` | **螺旋轮投影**:残基按 3.6 残基/圈落在圆周上、按性质着色,给出疏水矩 μH(判断是否两亲性),出 SVG |
|
|
213
217
|
| `molbio_hydropathy_plot` | **Kyte-Doolittle 疏水性图**:滑动窗口曲线 + GRAVY + 达到跨膜阈值的峰,出 SVG |
|
|
218
|
+
| `molbio_protein_features` | **蛋白注释**:PTM 基序(N-糖基化/甘露糖基化/肉豆蔻酰化/SUMO/PKA/CK2/脯氨酸导向)、SEG 风格低复杂度区、芳香性、Guruprasad 不稳定指数(>40 = unstable) |
|
|
219
|
+
| `molbio_signal_peptide` | **信号肽与跨膜段**:von Heijne 1986 −13..+2 权重(真核/革兰阴性),报切割位点/信号肽/候选位点;跨膜段与 `molbio_hydropathy_plot` 同窗口同阈值;出分数曲线 SVG |
|
|
220
|
+
| `molbio_antigenicity` | **抗原性**:Kolaskar–Tongaonkar 1990 的 7-mer A(p) 倾向 + Parker/Emini/Vihinen 区间均值;启发式排序,不是表位预测 |
|
|
214
221
|
|
|
215
222
|
### 7. 比对与保守性(7)
|
|
216
223
|
|
|
@@ -645,6 +652,24 @@ mutations remain deferred")。所以插件无法在工作区里合法地落一
|
|
|
645
652
|
*指示*,不是判定**,且只对闭合复制子有意义——序列太短时工具**不给**这个提示并说明原因。
|
|
646
653
|
简并碱基被排除在 skew/CpG/词频统计之外并计入 `n_percent`。
|
|
647
654
|
|
|
655
|
+
### 蛋白注释与测序判读(0.28.0)
|
|
656
|
+
|
|
657
|
+
- **三个蛋白工具都是发表表格的转录 + 滑窗,不是训练权重模型。** PTM 是线性共识基序(命中不等于
|
|
658
|
+
真的被修饰);低复杂度是 SEG 风格的熵窗口近似,不是 SEG 本身;不稳定指数用 Guruprasad 1990 的
|
|
659
|
+
DIWV 表(>40 按惯例读作 unstable)。不要把它们说成 SignalP/TMHMM/NetNGlyc/BepiPred 的预测。
|
|
660
|
+
- **信号肽**用 von Heijne 1986 的 −13..+2 位置权重(EMBOSS `sigcleave` 的两套表),分数是
|
|
661
|
+
`log(count/expected)` 求和;只扫描 N 端前 50 个残基(`max_cleavage` 可调),因为信号肽在 N 端,
|
|
662
|
+
全序列扫描会把中段偶然高分也报出来。**跨膜段**直接复用 `molbio_hydropathy_plot` 的窗口/阈值,
|
|
663
|
+
所以两个工具不会给出两套数;拓扑朝向**不预测**。
|
|
664
|
+
- **抗原性**是 Kolaskar–Tongaonkar 1990 的 7-mer A(p) 倾向:按“全蛋白均值 / 1.0”选位点,连续
|
|
665
|
+
≥6 个残基成区;Parker/Emini/Vihinen 只作为区间均值并列展示,**不合成单一分数**。
|
|
666
|
+
- **GFF3 与 BED 的坐标体系不同**:GFF3/CSV 是 1-based 闭区间,BED 是 0-based 半开(start−1 .. end)。
|
|
667
|
+
工具逐格式转换并在输出里写明;多段特征按**外边界**导出、原 `location` 保留;CDS phase 不建模,
|
|
668
|
+
列写 `.`——不猜一个看起来合理的数。**序列编辑不重映射特征**,编辑移动了注释就要重新导出。
|
|
669
|
+
- **Sanger 组装**是贪心 overlap-layout(读段双朝向、质量加权共识),不是基因组组装器;长于
|
|
670
|
+
`min_overlap` 的重复可能塌缩。**编辑结果归类**按精确变异签名聚类,频率是已比对 reads 的比例,
|
|
671
|
+
不做 TIDE 的混合峰分解;一条读还必须至少比对到自身一半长度(最少 20 bp),否则一段偶然的短
|
|
672
|
+
局部匹配会被误收成一个等位基因。
|
|
648
673
|
### 明确不做的事(以及为什么)
|
|
649
674
|
|
|
650
675
|
这些是这个工具集的**边界**,写在这里是为了不再重复勘察:**BAM/CRAM**(二进制格式)、
|
|
@@ -732,13 +757,13 @@ agent 的 shell 子进程继承**,内联参数会出现在对话记录与工
|
|
|
732
757
|
|
|
733
758
|
想评估"模型到底会不会用这些工具",看 **[benchmark/README.md](benchmark/README.md)**:
|
|
734
759
|
`npm run bench:offline` 零成本校验期望值(在 `npm test` 里),`npm run bench` 用真实模型
|
|
735
|
-
跑 **core 档 14 题**,`npm run bench:full` 跑**全部
|
|
760
|
+
跑 **core 档 14 题**,`npm run bench:full` 跑**全部 73 题(覆盖 72/72 个工具)**。
|
|
736
761
|
|
|
737
762
|
> **改动与 benchmark 的关系(硬规则)**:新增或改动任何工具行为,**必须**新增/更新对应的
|
|
738
763
|
> benchmark 任务并重跑;没有改动就不必重跑。日常只需要一条命令——
|
|
739
764
|
> `node benchmark/run.mjs --model --changed`——它会从你的改动反推出该跑哪几题
|
|
740
765
|
> (`lib.mjs` 这类共享库会自动放大到全量),改动只在文档/测试时则直接回答"无事可跑"。
|
|
741
|
-
> `test/benchmark-coverage.mjs` 会拦住"新工具没有任务"(断言
|
|
766
|
+
> `test/benchmark-coverage.mjs` 会拦住"新工具没有任务"(断言 72/72 覆盖),
|
|
742
767
|
> `bench --offline` 会拦住"期望值过期"。完整对照表见
|
|
743
768
|
> [docs/workflow.md](docs/workflow.md) 第 2 节。
|
|
744
769
|
|
|
@@ -765,7 +790,7 @@ agent 的 shell 子进程继承**,内联参数会出现在对话记录与工
|
|
|
765
790
|
|
|
766
791
|
```
|
|
767
792
|
dsh-molbio-tools/
|
|
768
|
-
├── index.mjs # 插件入口:export { name, inject, apply },注册
|
|
793
|
+
├── index.mjs # 插件入口:export { name, inject, apply },注册 72 个工具
|
|
769
794
|
├── lib.mjs # 基础库:IUPAC、翻译、酶表、NN 热力学、qPCR、lab math、甲基化/buffer 参考表
|
|
770
795
|
├── design.mjs # 引物自动设计(含跨内含子 qPCR)
|
|
771
796
|
├── taqman.mjs # TaqMan 水解探针设计(复用 design.mjs 的引物引擎)
|
package/benchmark/README.md
CHANGED
|
@@ -76,11 +76,11 @@ Measured, and printed so the answer can be audited:
|
|
|
76
76
|
|
|
77
77
|
```
|
|
78
78
|
$ touch crispr.mjs && node benchmark/run.mjs --list --changed
|
|
79
|
-
1 of
|
|
79
|
+
1 of 73 task(s) selected — --tools molbio_grna_design --changed
|
|
80
80
|
(from --changed; 2 module(s) affected: crispr.mjs, index.mjs)
|
|
81
81
|
|
|
82
82
|
$ touch lib.mjs && node benchmark/run.mjs --list --changed
|
|
83
|
-
|
|
83
|
+
62 of 73 task(s) selected — --changed (27 module(s) affected: align.mjs, cloning.mjs, …)
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
`lib.mjs` selecting nearly everything is the **correct** answer, not a failure to
|
|
@@ -102,7 +102,7 @@ you changed, so its task runs even if it is full-only.
|
|
|
102
102
|
| `--tools a,b,c` / `primer_*` | the union | you changed a few |
|
|
103
103
|
| `--changed --tools X` | the INTERSECTION | "of what I changed, test X" |
|
|
104
104
|
| (default) | **core** — 14 tasks | a broad smoke of the catalog |
|
|
105
|
-
| `--tier full` | all
|
|
105
|
+
| `--tier full` | all 73, 72/72 tools | before a release |
|
|
106
106
|
|
|
107
107
|
The two `--tools` operators are stated because confusing them is the difference
|
|
108
108
|
between testing what you changed and testing **less** than that: alone it unions,
|
|
@@ -134,7 +134,7 @@ and `test/benchmark-changed.mjs` asserts both directions.
|
|
|
134
134
|
### The part that still runs in full, on purpose
|
|
135
135
|
|
|
136
136
|
A model run with `--changed` or `--tools` first executes the **whole** offline
|
|
137
|
-
gate: all
|
|
137
|
+
gate: all 73 tasks' `where: "tool"` expectations are recomputed against the shipped
|
|
138
138
|
tools (no model, a few hundred milliseconds). That is what makes partial runs safe
|
|
139
139
|
— the expected values are re-proven for the tasks you skipped, so "skipped because
|
|
140
140
|
unchanged" is a checked claim, not a remembered one.
|
|
@@ -169,7 +169,7 @@ asserting whatever the tool happened to emit.
|
|
|
169
169
|
|
|
170
170
|
Two guards make "someone forgot" fail loudly instead of quietly:
|
|
171
171
|
|
|
172
|
-
- `test/benchmark-coverage.mjs` asserts **
|
|
172
|
+
- `test/benchmark-coverage.mjs` asserts **72/72 registered tools are covered by
|
|
173
173
|
at least one task**. Adding a tool without a task is a red build. It also
|
|
174
174
|
asserts the fixtures' premises (the Golden Gate backbone is BsaI-free, the
|
|
175
175
|
mutagenesis template still admits a primer pair), that a `covers` entry names a
|
|
@@ -210,7 +210,7 @@ recorded tool text, and it says so instead of silently scoring empty text).
|
|
|
210
210
|
|
|
211
211
|
## The headless profile (`benchmark/profile.mjs`)
|
|
212
212
|
|
|
213
|
-
The model-facing way to get the
|
|
213
|
+
The model-facing way to get the 72 tools is the **Molecular Biology Lab** agent
|
|
214
214
|
preset. The benchmark cannot use it, and the reason is structural rather than
|
|
215
215
|
configurational — `dsh-headless/lib/index.js` refuses an adoption whose session
|
|
216
216
|
records a preset:
|
|
@@ -568,7 +568,7 @@ implementation happens to return for one set of arguments.**
|
|
|
568
568
|
and `args_ok` both true is a *reporting* finding, not a tool bug.
|
|
569
569
|
- **Multimodal hand-off.** `attach_image` is exercised as an argument at most; no
|
|
570
570
|
assertion inspects a decoded PNG (that is `svgpng.mjs` and `contract.mjs`).
|
|
571
|
-
- **Most of the toolset is now covered, but shallowly.**
|
|
571
|
+
- **Most of the toolset is now covered, but shallowly.** 73 tasks touch all 72
|
|
572
572
|
tools; most tools appear in exactly one task, and several appearances are a
|
|
573
573
|
single argument check rather than a full workflow. Breadth is asserted by
|
|
574
574
|
`test/benchmark-coverage.mjs`; depth is not, and cannot be.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-molbio-tools/benchmark/_probe-v28.mjs
|
|
3
|
+
*
|
|
4
|
+
* Reproducible record of the INPUTS behind the v0.28.0 benchmark tasks, and of
|
|
5
|
+
* what the shipped tools render for them. `tasks/*.json` carries the expected
|
|
6
|
+
* text; this file carries the invocation that must still produce it, so a tool
|
|
7
|
+
* change shows up as a failing task rather than as a silently rewritten
|
|
8
|
+
* expectation.
|
|
9
|
+
*
|
|
10
|
+
* Run: node benchmark/_probe-v28.mjs
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { join, resolve } from 'node:path';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
|
|
16
|
+
import { loadTools } from './tools.mjs';
|
|
17
|
+
|
|
18
|
+
process.env.MOLBIO_AUTO_VIEW = '0';
|
|
19
|
+
|
|
20
|
+
const here = resolve(fileURLToPath(import.meta.url), '..');
|
|
21
|
+
const workspaceRoot = resolve(here, '_probe-v28-workspace');
|
|
22
|
+
const harness = loadTools({ workspaceRoot });
|
|
23
|
+
|
|
24
|
+
const ASSEMBLY_REF = 'GCGTGGTTATAATACAAGTTGAGCATATAAGGTTTGACAGCCTCTGACGCCTGCGGCGAAGGCCCATAATGGTACCGGAAGACTTCCGCCTCGATGCATCACTCACATCGGTGTCACCTGTTGTCGTCCGTTAACAAGTAGCAGGTTAGATCCGATCCGCGTCTAGGAGTGATCCTTATCAAATTGACTCAAAGGCGATATACAGCGAAAACATCAACCGTGGACTTCAGGAACACGGTGTGAGGGTTGGTCTCTTTTGAGAGATATTACAGACACTTTCTGGAGGACAACCGTGGTTTGGAACTGAATTGTCAAGGCGACATTACCTTAAAGCGTAGTTGGGTGGTGACTTTGAGCTGATGATAACGTAGGGACCAGCAATGTTTATACCGAACATGGA';
|
|
25
|
+
const ASSEMBLY_READS = [
|
|
26
|
+
{ name: 'r1', sequence: ASSEMBLY_REF.slice(0, 220) },
|
|
27
|
+
{ name: 'r2', sequence: ASSEMBLY_REF.slice(150, 370) },
|
|
28
|
+
{ name: 'r3', sequence: 'TCCATGTTCGGTATAAACATTGCTGGTCCCTACGTTATCATCAGCTCAAAGTCACCACCCAACTACGCTTTAAGGTAATGTCGCCTTGACAATTCAGTTCCAAACCACGGTTGTCCTCCA' },
|
|
29
|
+
];
|
|
30
|
+
const EDIT_REF = 'ATG' + 'GCT'.repeat(30) + 'TAA';
|
|
31
|
+
const EDIT_READS = [
|
|
32
|
+
{ name: 'wt1', sequence: EDIT_REF },
|
|
33
|
+
{ name: 'wt2', sequence: EDIT_REF },
|
|
34
|
+
{ name: 'del', sequence: EDIT_REF.slice(0, 3) + EDIT_REF.slice(6) },
|
|
35
|
+
{ name: 'sub', sequence: EDIT_REF.slice(0, 3) + 'A' + EDIT_REF.slice(4) },
|
|
36
|
+
];
|
|
37
|
+
const INSULIN = 'MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN';
|
|
38
|
+
|
|
39
|
+
const probes = [
|
|
40
|
+
['protein-features', 'molbio_protein_features', { sequence: 'AANASWAAWGEASTALKAERRASAAE' + 'A'.repeat(16) }],
|
|
41
|
+
['signal-peptide', 'molbio_signal_peptide', { sequence: INSULIN.slice(0, 40) }],
|
|
42
|
+
['antigenicity', 'molbio_antigenicity', { sequence: INSULIN }],
|
|
43
|
+
['feature-export', 'molbio_feature_export', { sequence: 'ACGTACGTAC', features: [{ type: 'CDS', start: 2, end: 6, strand: 1, label: 'gene1' }], format: 'gff3' }],
|
|
44
|
+
['sequence-edit', 'molbio_sequence_edit', { sequence: 'AACCGGTT', operation: 'rotate', position: 3 }],
|
|
45
|
+
['sanger-assemble', 'molbio_sanger_assemble', { reads: ASSEMBLY_READS, min_overlap: 40, trim_quality: 0 }],
|
|
46
|
+
['editing-outcome', 'molbio_editing_outcome', { reads: EDIT_READS, reference: EDIT_REF, circular: false, cds_start: 1, cds_end: EDIT_REF.length }],
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
for (const [name, tool, args] of probes) {
|
|
50
|
+
try {
|
|
51
|
+
const value = await harness.run(tool, args);
|
|
52
|
+
const text = harness.render(tool, args, value);
|
|
53
|
+
console.log(`===== ${name} [${tool}]`);
|
|
54
|
+
console.log(text);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.log(`===== ${name} ERROR ${String(error)}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
void join;
|