dsh-molbio-panel 0.0.0-stage → 0.1.3
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/README.md +62 -2
- package/cordis.patch.yml +7 -0
- package/index.mjs +33 -0
- package/lib/client.js +9113 -0
- package/package.json +55 -4
package/README.md
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-molbio-panel
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DSH Web GUI 的**浏览器内 Molbio 面板**:右侧栏的一个 tab,列出当前会话工作区的序列文件,
|
|
4
|
+
选中当场画出来——`.dna` / `.gb` / `.gbk` 出质粒图谱,`.fa` / `.fasta` 出序列标识图。
|
|
5
|
+
|
|
6
|
+
解析与渲染在浏览器里跑的是 [`dsh-molbio-tools`](https://github.com/lovy2004/dsh-molbio-tools)
|
|
7
|
+
的**同一份源码**(`lib/genbank/snapgene/plasmid/msa/logo`)——不落盘 SVG、不弹系统查看器、
|
|
8
|
+
不经过工具调用。
|
|
9
|
+
|
|
10
|
+
## 为什么是单独的包
|
|
11
|
+
|
|
12
|
+
面板必须走 **bundle 渠道**(`dsh.client` 双面包):preset 渠道挂不了客户端 UI
|
|
13
|
+
(详见 `dsh-molbio-tools` 仓库的 `docs/client-pipeline-exploration.md`)。
|
|
14
|
+
|
|
15
|
+
而 `dsh-molbio-tools` 的宿主半边会注册 **46 个工具**——把它挂进一个共享的 Web profile,
|
|
16
|
+
等于给**该 profile 的每个会话**都塞进这些工具。所以面板单独成包:
|
|
17
|
+
|
|
18
|
+
| 包 | 宿主半边 | 用途 |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| `dsh-molbio-tools` | 46 个 molbio 工具 | 分子生物学专用 profile / preset |
|
|
21
|
+
| `dsh-molbio-panel` | **不注册任何工具**(空实现) | 只想在共享 profile 里加一个面板 |
|
|
22
|
+
|
|
23
|
+
宿主半边刻意保持空:客户端扫描按 **Loader 条目**取包清单,条目只要能加载,浏览器半就能
|
|
24
|
+
被发现——这正是"面板与工具解耦"能成立的原因。
|
|
25
|
+
|
|
26
|
+
## 安装
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
dsh plugin --profile <profile> add dsh-molbio-panel # npm 包
|
|
30
|
+
dsh plugin --profile <profile> add D:\path\to\packages\molbio-panel # 本地目录
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
装完**刷新页面**(不需要重建 Web 应用)。右栏引导页里会出现 **Molbio** 胶囊。
|
|
34
|
+
|
|
35
|
+
## 用法
|
|
36
|
+
|
|
37
|
+
1. 打开右侧栏(会话头部角落的按钮),从引导页选 **Molbio**。
|
|
38
|
+
2. 左栏列出工作区里可打开的文件(质粒文件排在前面)。
|
|
39
|
+
3. 点一个 `.dna` / `.gb` → 右侧出图谱 + 特征表(Feature / Type / Start / End / Strand);
|
|
40
|
+
点一个 `.fasta`(≥2 条序列)→ 出序列标识图(信息量 bits,小样本校正默认开)。
|
|
41
|
+
|
|
42
|
+
## 限制
|
|
43
|
+
|
|
44
|
+
- **只读**:只列目录第一层,不写文件。
|
|
45
|
+
- 完整文件读取受部署的 `workspaceFiles` 上限约束(`maxFileBytes` 默认 **32 MiB**,
|
|
46
|
+
`maxEntries` 默认 **2000**);列表与读取的错误会原样显示在面板里。
|
|
47
|
+
- 特征表最多渲染 200 行(图谱本身按渲染器上限画)。
|
|
48
|
+
- 面板用宿主提供的 `remote` 与插槽服务;在缺少右栏(`dsh-client-ui-sidebar-right`)的
|
|
49
|
+
组合里不会出现。
|
|
50
|
+
|
|
51
|
+
## 开发
|
|
52
|
+
|
|
53
|
+
产物 `lib/client.js` 由 `dsh-molbio-tools` 仓库的打包器生成(两个包在同一趟构建里产出,
|
|
54
|
+
因此不会漂移):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
cd <dsh-molbio-tools>
|
|
58
|
+
node build/client-bundle.mjs # 同时写 lib/client.js 与 packages/molbio-panel/lib/client.js
|
|
59
|
+
node test/client.mjs # 产物格式 + 数据通路(按加载器方式执行)
|
|
60
|
+
node test/client-mount.mjs # 复刻宿主侧图扫描,核对依赖与挂载
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
产物**必须与源码一起提交**:`dsh plugin add` 装的是产物,用户机器上没有构建步骤。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# The dsh-molbio-panel bundle patch: one plugin row, mounted by package name.
|
|
2
|
+
#
|
|
3
|
+
# The client scan keys on this Loader entry, so the row must load for the
|
|
4
|
+
# browser half to be discovered even though the host half registers nothing.
|
|
5
|
+
- insert:
|
|
6
|
+
- id: molbio-panel
|
|
7
|
+
name: dsh-molbio-panel
|
package/index.mjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-molbio-panel — host half.
|
|
3
|
+
*
|
|
4
|
+
* This package exists so the browser panel can be installed WITHOUT dragging
|
|
5
|
+
* the 46 molbio tools into every session of a profile. It is a `dsh.client`
|
|
6
|
+
* dual-face package: the host half below, and the browser half built from the
|
|
7
|
+
* `dsh-molbio-tools` sources into `lib/client.js`.
|
|
8
|
+
*
|
|
9
|
+
* The host half deliberately registers no tool and publishes no service. A
|
|
10
|
+
* Cordis plugin row only needs to load, because the client scan keys on the
|
|
11
|
+
* Loader entry: the row's package manifest is what carries `dsh.client` and
|
|
12
|
+
* `exports["./client"]`, and that is how the browser bundle reaches the page.
|
|
13
|
+
*
|
|
14
|
+
* `inject` is declared even though the row touches no service, so Cordis holds
|
|
15
|
+
* the row's fiber until the tool registry exists — the same ordering the rest
|
|
16
|
+
* of the preset relies on, and a loud failure if this row is ever mounted in a
|
|
17
|
+
* composition without one.
|
|
18
|
+
*
|
|
19
|
+
* To get the tools as well, install `dsh-molbio-tools` (the preset or the
|
|
20
|
+
* bundle), or the Molecular Biology Lab preset, which carries both.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** Cordis plugin name. */
|
|
24
|
+
export const name = 'molbio-panel';
|
|
25
|
+
|
|
26
|
+
/** Required service: the tool registry, present in every agent/host composition. */
|
|
27
|
+
export const inject = ['tools'];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Host-half body. Intentionally empty: this row exists to make the package's
|
|
31
|
+
* browser half discoverable, not to contribute host capability.
|
|
32
|
+
*/
|
|
33
|
+
export function apply() {}
|