@openbiox/bizard-mcp 0.1.3 → 0.1.4
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 +4 -0
- package/dist/prompts.js +4 -2
- package/dist/server.js +1 -1
- package/dist/snapshot/bundle.json +412 -3
- package/dist/snapshot/llms.txt +11 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,10 @@ degrades gracefully by environment). Content comes from a bundle generated by
|
|
|
11
11
|
CI from the same sources as the website and `SKILL.md`, so all three never
|
|
12
12
|
drift. The server never executes plotting code — the host AI does.
|
|
13
13
|
|
|
14
|
+
If Bizard helps your research, please cite: Li, K., Zheng, H., et al. (2026).
|
|
15
|
+
Bizard: A Community-Driven Platform for Accelerating and Enhancing Biomedical
|
|
16
|
+
Data Visualization. *iMetaMed*, e70038. <https://doi.org/10.1002/imm3.70038>
|
|
17
|
+
|
|
14
18
|
## Quickstart
|
|
15
19
|
|
|
16
20
|
No install at all — connect to the [public hosted instance](#public-hosted-instance-no-install-required)
|
package/dist/prompts.js
CHANGED
|
@@ -13,7 +13,8 @@ export function registerPrompts(server) {
|
|
|
13
13
|
2. Call bizard_search with 2-3 keyword variants (EN and zh).
|
|
14
14
|
3. Compare the top hits on: data types required, message emphasis, aesthetics.
|
|
15
15
|
4. Recommend ONE chart plus 2 alternatives, with tutorial URLs from the results.
|
|
16
|
-
5. Remind the user that code should be adapted to their data (offer the adapt prompt)
|
|
16
|
+
5. Remind the user that code should be adapted to their data (offer the adapt prompt).
|
|
17
|
+
6. When the user adopts a chart from Bizard, remind them to cite the Bizard paper (Li et al., iMetaMed 2026, doi:10.1002/imm3.70038).`,
|
|
17
18
|
},
|
|
18
19
|
}],
|
|
19
20
|
}));
|
|
@@ -33,7 +34,8 @@ export function registerPrompts(server) {
|
|
|
33
34
|
2. FIRST inspect my data (str/df.info/head) — do not assume column names.
|
|
34
35
|
3. Rewrite the tutorial code from bizard_get_code minimally: only parameter and column changes.
|
|
35
36
|
4. Run the adapted code, show the plot, and self-check against the guidance's failure modes.
|
|
36
|
-
5. If a step fails, switch to the troubleshoot flow before improvising
|
|
37
|
+
5. If a step fails, switch to the troubleshoot flow before improvising.
|
|
38
|
+
6. When the adapted figure is used in the user's work, remind them to cite the Bizard paper (Li et al., iMetaMed 2026, doi:10.1002/imm3.70038).`,
|
|
37
39
|
},
|
|
38
40
|
}],
|
|
39
41
|
}));
|
package/dist/server.js
CHANGED
|
@@ -38,7 +38,7 @@ function bundleError() {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
/** Constant server identity — never derives from bundle state. */
|
|
41
|
-
const SERVER_IDENTITY = { name: "bizard-mcp", version: "0.1.
|
|
41
|
+
const SERVER_IDENTITY = { name: "bizard-mcp", version: "0.1.4" };
|
|
42
42
|
export function createBizardServer(source, notices, opts) {
|
|
43
43
|
const getBundle = () => {
|
|
44
44
|
if (source === null)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"meta": {
|
|
3
3
|
"siteVersion": "",
|
|
4
4
|
"bundleVersion": 1,
|
|
5
|
-
"generatedAt": "2026-10-
|
|
5
|
+
"generatedAt": "2026-10-16T16:56:06.902254+00:00",
|
|
6
6
|
"license": "CC-BY-NC-4.0"
|
|
7
7
|
},
|
|
8
8
|
"categories": [
|
|
@@ -56,6 +56,11 @@
|
|
|
56
56
|
"nameZh": null,
|
|
57
57
|
"count": 61
|
|
58
58
|
},
|
|
59
|
+
{
|
|
60
|
+
"name": "FcFcPlot",
|
|
61
|
+
"nameZh": null,
|
|
62
|
+
"count": 3
|
|
63
|
+
},
|
|
59
64
|
{
|
|
60
65
|
"name": "GeneStructurePlot",
|
|
61
66
|
"nameZh": null,
|
|
@@ -121,6 +126,11 @@
|
|
|
121
126
|
"nameZh": null,
|
|
122
127
|
"count": 6
|
|
123
128
|
},
|
|
129
|
+
{
|
|
130
|
+
"name": "MutationOncoplot",
|
|
131
|
+
"nameZh": null,
|
|
132
|
+
"count": 3
|
|
133
|
+
},
|
|
124
134
|
{
|
|
125
135
|
"name": "NetworkPlot",
|
|
126
136
|
"nameZh": null,
|
|
@@ -12427,6 +12437,96 @@
|
|
|
12427
12437
|
"codeRefs": [
|
|
12428
12438
|
"python"
|
|
12429
12439
|
]
|
|
12440
|
+
},
|
|
12441
|
+
{
|
|
12442
|
+
"id": "FcFcPlot-817",
|
|
12443
|
+
"name": "Basic FC-FC Scatter Plot",
|
|
12444
|
+
"nameZh": "基础 FC-FC 散点图",
|
|
12445
|
+
"type": "FC-FC Scatter Plot",
|
|
12446
|
+
"level1": "OMICS",
|
|
12447
|
+
"level2": "FcFcPlot",
|
|
12448
|
+
"tutorialUrl": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html#fig-1.1BasicFcFc",
|
|
12449
|
+
"tutorialUrlZh": "https://openbiox.github.io/Bizard/zh/Omics/FcFcPlot.html#fig-1.1BasicFcFc",
|
|
12450
|
+
"imageUrl": "https://openbiox.github.io/Bizard/Omics/FcFcPlot_files/figure-html/fig-1.1BasicFcFc-1.png",
|
|
12451
|
+
"description": "Basic FC-FC scatter plot with fold-change threshold lines and a reference diagonal built with ggplot2",
|
|
12452
|
+
"codeRefs": [
|
|
12453
|
+
"r"
|
|
12454
|
+
]
|
|
12455
|
+
},
|
|
12456
|
+
{
|
|
12457
|
+
"id": "FcFcPlot-818",
|
|
12458
|
+
"name": "Color points by significance category",
|
|
12459
|
+
"nameZh": "按显著性类别着色",
|
|
12460
|
+
"type": "FC-FC Scatter Plot",
|
|
12461
|
+
"level1": "OMICS",
|
|
12462
|
+
"level2": "FcFcPlot",
|
|
12463
|
+
"tutorialUrl": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html#fig-1.2CategoryFcFc",
|
|
12464
|
+
"tutorialUrlZh": "https://openbiox.github.io/Bizard/zh/Omics/FcFcPlot.html#fig-1.2CategoryFcFc",
|
|
12465
|
+
"imageUrl": "https://openbiox.github.io/Bizard/Omics/FcFcPlot_files/figure-html/fig-1.2CategoryFcFc-1.png",
|
|
12466
|
+
"description": "Points colored by significance category — shared / subset-specific / discordant markers",
|
|
12467
|
+
"codeRefs": [
|
|
12468
|
+
"r"
|
|
12469
|
+
]
|
|
12470
|
+
},
|
|
12471
|
+
{
|
|
12472
|
+
"id": "FcFcPlot-819",
|
|
12473
|
+
"name": "FC-FC scatter plot with significance-scaled points and curated gene labels",
|
|
12474
|
+
"nameZh": "点大小编码显著性并标注基因的 FC-FC 散点图",
|
|
12475
|
+
"type": "FC-FC Scatter Plot",
|
|
12476
|
+
"level1": "OMICS",
|
|
12477
|
+
"level2": "FcFcPlot",
|
|
12478
|
+
"tutorialUrl": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html#fig-1.3LabelFcFc",
|
|
12479
|
+
"tutorialUrlZh": "https://openbiox.github.io/Bizard/zh/Omics/FcFcPlot.html#fig-1.3LabelFcFc",
|
|
12480
|
+
"imageUrl": "https://openbiox.github.io/Bizard/Omics/FcFcPlot_files/figure-html/fig-1.3LabelFcFc-1.png",
|
|
12481
|
+
"description": "Point size encodes statistical significance and genes at the extremes and top shared markers are labeled",
|
|
12482
|
+
"codeRefs": [
|
|
12483
|
+
"r"
|
|
12484
|
+
]
|
|
12485
|
+
},
|
|
12486
|
+
{
|
|
12487
|
+
"id": "MutationOncoplot-820",
|
|
12488
|
+
"name": "Basic Mutation Landscape Oncoplot",
|
|
12489
|
+
"nameZh": "基础基因突变全景瀑布图",
|
|
12490
|
+
"type": "Mutation Landscape Oncoplot",
|
|
12491
|
+
"level1": "OMICS",
|
|
12492
|
+
"level2": "MutationOncoplot",
|
|
12493
|
+
"tutorialUrl": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html#fig-1.1BasicOncoplot",
|
|
12494
|
+
"tutorialUrlZh": "https://openbiox.github.io/Bizard/zh/Omics/MutationOncoplot.html#fig-1.1BasicOncoplot",
|
|
12495
|
+
"imageUrl": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot_files/figure-html/fig-1.1BasicOncoplot-1.png",
|
|
12496
|
+
"description": "Basic oncoplot showing the simulated cohort mutation matrix with per-gene frequencies and alteration counts",
|
|
12497
|
+
"codeRefs": [
|
|
12498
|
+
"r"
|
|
12499
|
+
]
|
|
12500
|
+
},
|
|
12501
|
+
{
|
|
12502
|
+
"id": "MutationOncoplot-821",
|
|
12503
|
+
"name": "Oncoplot split by molecular subtype with mutation burden bars",
|
|
12504
|
+
"nameZh": "按分子亚型拆分并带突变负荷条的 oncoplot",
|
|
12505
|
+
"type": "Mutation Landscape Oncoplot",
|
|
12506
|
+
"level1": "OMICS",
|
|
12507
|
+
"level2": "MutationOncoplot",
|
|
12508
|
+
"tutorialUrl": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html#fig-1.2CohortOncoplot",
|
|
12509
|
+
"tutorialUrlZh": "https://openbiox.github.io/Bizard/zh/Omics/MutationOncoplot.html#fig-1.2CohortOncoplot",
|
|
12510
|
+
"imageUrl": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot_files/figure-html/fig-1.2CohortOncoplot-1.png",
|
|
12511
|
+
"description": "Samples split by molecular subtype with a top barplot of each sample's total mutation count",
|
|
12512
|
+
"codeRefs": [
|
|
12513
|
+
"r"
|
|
12514
|
+
]
|
|
12515
|
+
},
|
|
12516
|
+
{
|
|
12517
|
+
"id": "MutationOncoplot-822",
|
|
12518
|
+
"name": "Oncoplot with genes grouped by signaling pathway",
|
|
12519
|
+
"nameZh": "按信号通路分组基因的 oncoplot",
|
|
12520
|
+
"type": "Mutation Landscape Oncoplot",
|
|
12521
|
+
"level1": "OMICS",
|
|
12522
|
+
"level2": "MutationOncoplot",
|
|
12523
|
+
"tutorialUrl": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html#fig-1.3PathwayOncoplot",
|
|
12524
|
+
"tutorialUrlZh": "https://openbiox.github.io/Bizard/zh/Omics/MutationOncoplot.html#fig-1.3PathwayOncoplot",
|
|
12525
|
+
"imageUrl": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot_files/figure-html/fig-1.3PathwayOncoplot-1.png",
|
|
12526
|
+
"description": "The same cohort with genes grouped by signaling pathway for a functional reading of the landscape",
|
|
12527
|
+
"codeRefs": [
|
|
12528
|
+
"r"
|
|
12529
|
+
]
|
|
12430
12530
|
}
|
|
12431
12531
|
],
|
|
12432
12532
|
"codeSnippets": [
|
|
@@ -168932,6 +169032,315 @@
|
|
|
168932
169032
|
],
|
|
168933
169033
|
"dataUrls": [],
|
|
168934
169034
|
"sourceAnchor": "https://openbiox.github.io/Bizard/Python/VolcanoPlot.html"
|
|
169035
|
+
},
|
|
169036
|
+
{
|
|
169037
|
+
"chartId": "FcFcPlot-817",
|
|
169038
|
+
"lang": "r",
|
|
169039
|
+
"code": "# Load the PBMC marker gene table\ndata(\"pbmc.markers\")\n\n# Marker statistics of the two monocyte subsets\ncd14 <- pbmc.markers |>\n filter(cluster == \"CD14+ Mono\") |>\n select(gene, avg_log2FC, p_val_adj)\n\nfcgr3a <- pbmc.markers |>\n filter(cluster == \"FCGR3A+ Mono\") |>\n select(gene, avg_log2FC, p_val_adj)\n\n# Join by gene: 546 genes are markers in both subsets\nfc_fc <- inner_join(cd14, fcgr3a, by = \"gene\", suffix = c(\"_cd14\", \"_fcgr3a\"))\n\n# Classify each gene and compute the plotting score\nfc_cut <- 0.5\np_cut <- 0.05\nfc_fc <- fc_fc |>\n mutate(\n sig_cd14 = p_val_adj_cd14 < p_cut & abs(avg_log2FC_cd14) >= fc_cut,\n sig_fcgr3a = p_val_adj_fcgr3a < p_cut & abs(avg_log2FC_fcgr3a) >= fc_cut,\n category = case_when(\n sig_cd14 & sig_fcgr3a & sign(avg_log2FC_cd14) == sign(avg_log2FC_fcgr3a) ~ \"Shared marker\",\n sig_cd14 & sig_fcgr3a ~ \"Discordant\",\n sig_cd14 ~ \"CD14+ Mono-specific\",\n sig_fcgr3a ~ \"FCGR3A+ Mono-specific\",\n TRUE ~ \"Not significant\"\n ),\n neglog10p = -log10(pmax(p_val_adj_cd14, p_val_adj_fcgr3a))\n )\n\n# View data\nhead(fc_fc)",
|
|
169040
|
+
"packages": [
|
|
169041
|
+
"ggrepel",
|
|
169042
|
+
"scRNAtoolVis",
|
|
169043
|
+
"tidyverse"
|
|
169044
|
+
],
|
|
169045
|
+
"dataUrls": [],
|
|
169046
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169047
|
+
},
|
|
169048
|
+
{
|
|
169049
|
+
"chartId": "FcFcPlot-817",
|
|
169050
|
+
"lang": "r",
|
|
169051
|
+
"code": "ggplot(fc_fc, aes(avg_log2FC_cd14, avg_log2FC_fcgr3a)) +\n geom_hline(yintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_vline(xintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_abline(slope = 1, intercept = 0, linetype = \"dotted\", color = \"grey60\") +\n geom_point(color = \"#2166AC\", size = 1.8, alpha = 0.7) +\n labs(x = expression(log[2]*FC~\"(CD14+ Mono vs rest)\"),\n y = expression(log[2]*FC~\"(FCGR3A+ Mono vs rest)\")) +\n theme_bw()",
|
|
169052
|
+
"packages": [
|
|
169053
|
+
"ggrepel",
|
|
169054
|
+
"scRNAtoolVis",
|
|
169055
|
+
"tidyverse"
|
|
169056
|
+
],
|
|
169057
|
+
"dataUrls": [],
|
|
169058
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169059
|
+
},
|
|
169060
|
+
{
|
|
169061
|
+
"chartId": "FcFcPlot-817",
|
|
169062
|
+
"lang": "r",
|
|
169063
|
+
"code": "category_colors <- c(\n \"Shared marker\" = \"#B2182B\",\n \"Discordant\" = \"#7B3294\",\n \"CD14+ Mono-specific\" = \"#2166AC\",\n \"FCGR3A+ Mono-specific\" = \"#1B9E77\",\n \"Not significant\" = \"grey70\"\n)\n\nggplot(fc_fc, aes(avg_log2FC_cd14, avg_log2FC_fcgr3a)) +\n geom_hline(yintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_vline(xintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_point(aes(color = category), size = 2, alpha = 0.75) +\n scale_color_manual(values = category_colors) +\n labs(x = expression(log[2]*FC~\"(CD14+ Mono vs rest)\"),\n y = expression(log[2]*FC~\"(FCGR3A+ Mono vs rest)\"),\n color = \"Category\") +\n theme_bw()",
|
|
169064
|
+
"packages": [
|
|
169065
|
+
"ggrepel",
|
|
169066
|
+
"scRNAtoolVis",
|
|
169067
|
+
"tidyverse"
|
|
169068
|
+
],
|
|
169069
|
+
"dataUrls": [],
|
|
169070
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169071
|
+
},
|
|
169072
|
+
{
|
|
169073
|
+
"chartId": "FcFcPlot-817",
|
|
169074
|
+
"lang": "r",
|
|
169075
|
+
"code": "# Curated label set: discordant genes, extremes on both axes and top shared markers\nlabel_genes <- bind_rows(\n fc_fc |> filter(category == \"Discordant\") |>\n slice_max(abs(avg_log2FC_cd14 - avg_log2FC_fcgr3a), n = 3),\n fc_fc |> slice_max(abs(avg_log2FC_cd14), n = 3),\n fc_fc |> slice_max(abs(avg_log2FC_fcgr3a), n = 3),\n fc_fc |> filter(gene == \"MS4A7\"),\n fc_fc |> filter(category == \"Shared marker\") |>\n slice_max(neglog10p + pmin(abs(avg_log2FC_cd14), abs(avg_log2FC_fcgr3a)), n = 6)\n) |>\n distinct(gene, .keep_all = TRUE)\n\nggplot(fc_fc, aes(avg_log2FC_cd14, avg_log2FC_fcgr3a)) +\n geom_hline(yintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_vline(xintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_abline(slope = 1, intercept = 0, linetype = \"dotted\", color = \"grey60\") +\n geom_point(aes(color = category, size = neglog10p), alpha = 0.75) +\n scale_color_manual(values = category_colors) +\n scale_size_continuous(range = c(0.8, 5), name = expression(-log[10](P[adj]))) +\n geom_text_repel(data = label_genes, aes(label = gene, color = category),\n size = 3.1, fontface = \"italic\", max.overlaps = 40,\n box.padding = 0.55, segment.size = 0.25,\n show.legend = FALSE, seed = 1) +\n labs(x = expression(log[2]*FC~\"(CD14+ Mono vs rest)\"),\n y = expression(log[2]*FC~\"(FCGR3A+ Mono vs rest)\"),\n color = \"Category\") +\n theme_bw()",
|
|
169076
|
+
"packages": [
|
|
169077
|
+
"ggrepel",
|
|
169078
|
+
"scRNAtoolVis",
|
|
169079
|
+
"tidyverse"
|
|
169080
|
+
],
|
|
169081
|
+
"dataUrls": [],
|
|
169082
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169083
|
+
},
|
|
169084
|
+
{
|
|
169085
|
+
"chartId": "FcFcPlot-818",
|
|
169086
|
+
"lang": "r",
|
|
169087
|
+
"code": "# Load the PBMC marker gene table\ndata(\"pbmc.markers\")\n\n# Marker statistics of the two monocyte subsets\ncd14 <- pbmc.markers |>\n filter(cluster == \"CD14+ Mono\") |>\n select(gene, avg_log2FC, p_val_adj)\n\nfcgr3a <- pbmc.markers |>\n filter(cluster == \"FCGR3A+ Mono\") |>\n select(gene, avg_log2FC, p_val_adj)\n\n# Join by gene: 546 genes are markers in both subsets\nfc_fc <- inner_join(cd14, fcgr3a, by = \"gene\", suffix = c(\"_cd14\", \"_fcgr3a\"))\n\n# Classify each gene and compute the plotting score\nfc_cut <- 0.5\np_cut <- 0.05\nfc_fc <- fc_fc |>\n mutate(\n sig_cd14 = p_val_adj_cd14 < p_cut & abs(avg_log2FC_cd14) >= fc_cut,\n sig_fcgr3a = p_val_adj_fcgr3a < p_cut & abs(avg_log2FC_fcgr3a) >= fc_cut,\n category = case_when(\n sig_cd14 & sig_fcgr3a & sign(avg_log2FC_cd14) == sign(avg_log2FC_fcgr3a) ~ \"Shared marker\",\n sig_cd14 & sig_fcgr3a ~ \"Discordant\",\n sig_cd14 ~ \"CD14+ Mono-specific\",\n sig_fcgr3a ~ \"FCGR3A+ Mono-specific\",\n TRUE ~ \"Not significant\"\n ),\n neglog10p = -log10(pmax(p_val_adj_cd14, p_val_adj_fcgr3a))\n )\n\n# View data\nhead(fc_fc)",
|
|
169088
|
+
"packages": [
|
|
169089
|
+
"ggrepel",
|
|
169090
|
+
"scRNAtoolVis",
|
|
169091
|
+
"tidyverse"
|
|
169092
|
+
],
|
|
169093
|
+
"dataUrls": [],
|
|
169094
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169095
|
+
},
|
|
169096
|
+
{
|
|
169097
|
+
"chartId": "FcFcPlot-818",
|
|
169098
|
+
"lang": "r",
|
|
169099
|
+
"code": "ggplot(fc_fc, aes(avg_log2FC_cd14, avg_log2FC_fcgr3a)) +\n geom_hline(yintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_vline(xintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_abline(slope = 1, intercept = 0, linetype = \"dotted\", color = \"grey60\") +\n geom_point(color = \"#2166AC\", size = 1.8, alpha = 0.7) +\n labs(x = expression(log[2]*FC~\"(CD14+ Mono vs rest)\"),\n y = expression(log[2]*FC~\"(FCGR3A+ Mono vs rest)\")) +\n theme_bw()",
|
|
169100
|
+
"packages": [
|
|
169101
|
+
"ggrepel",
|
|
169102
|
+
"scRNAtoolVis",
|
|
169103
|
+
"tidyverse"
|
|
169104
|
+
],
|
|
169105
|
+
"dataUrls": [],
|
|
169106
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169107
|
+
},
|
|
169108
|
+
{
|
|
169109
|
+
"chartId": "FcFcPlot-818",
|
|
169110
|
+
"lang": "r",
|
|
169111
|
+
"code": "category_colors <- c(\n \"Shared marker\" = \"#B2182B\",\n \"Discordant\" = \"#7B3294\",\n \"CD14+ Mono-specific\" = \"#2166AC\",\n \"FCGR3A+ Mono-specific\" = \"#1B9E77\",\n \"Not significant\" = \"grey70\"\n)\n\nggplot(fc_fc, aes(avg_log2FC_cd14, avg_log2FC_fcgr3a)) +\n geom_hline(yintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_vline(xintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_point(aes(color = category), size = 2, alpha = 0.75) +\n scale_color_manual(values = category_colors) +\n labs(x = expression(log[2]*FC~\"(CD14+ Mono vs rest)\"),\n y = expression(log[2]*FC~\"(FCGR3A+ Mono vs rest)\"),\n color = \"Category\") +\n theme_bw()",
|
|
169112
|
+
"packages": [
|
|
169113
|
+
"ggrepel",
|
|
169114
|
+
"scRNAtoolVis",
|
|
169115
|
+
"tidyverse"
|
|
169116
|
+
],
|
|
169117
|
+
"dataUrls": [],
|
|
169118
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169119
|
+
},
|
|
169120
|
+
{
|
|
169121
|
+
"chartId": "FcFcPlot-818",
|
|
169122
|
+
"lang": "r",
|
|
169123
|
+
"code": "# Curated label set: discordant genes, extremes on both axes and top shared markers\nlabel_genes <- bind_rows(\n fc_fc |> filter(category == \"Discordant\") |>\n slice_max(abs(avg_log2FC_cd14 - avg_log2FC_fcgr3a), n = 3),\n fc_fc |> slice_max(abs(avg_log2FC_cd14), n = 3),\n fc_fc |> slice_max(abs(avg_log2FC_fcgr3a), n = 3),\n fc_fc |> filter(gene == \"MS4A7\"),\n fc_fc |> filter(category == \"Shared marker\") |>\n slice_max(neglog10p + pmin(abs(avg_log2FC_cd14), abs(avg_log2FC_fcgr3a)), n = 6)\n) |>\n distinct(gene, .keep_all = TRUE)\n\nggplot(fc_fc, aes(avg_log2FC_cd14, avg_log2FC_fcgr3a)) +\n geom_hline(yintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_vline(xintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_abline(slope = 1, intercept = 0, linetype = \"dotted\", color = \"grey60\") +\n geom_point(aes(color = category, size = neglog10p), alpha = 0.75) +\n scale_color_manual(values = category_colors) +\n scale_size_continuous(range = c(0.8, 5), name = expression(-log[10](P[adj]))) +\n geom_text_repel(data = label_genes, aes(label = gene, color = category),\n size = 3.1, fontface = \"italic\", max.overlaps = 40,\n box.padding = 0.55, segment.size = 0.25,\n show.legend = FALSE, seed = 1) +\n labs(x = expression(log[2]*FC~\"(CD14+ Mono vs rest)\"),\n y = expression(log[2]*FC~\"(FCGR3A+ Mono vs rest)\"),\n color = \"Category\") +\n theme_bw()",
|
|
169124
|
+
"packages": [
|
|
169125
|
+
"ggrepel",
|
|
169126
|
+
"scRNAtoolVis",
|
|
169127
|
+
"tidyverse"
|
|
169128
|
+
],
|
|
169129
|
+
"dataUrls": [],
|
|
169130
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169131
|
+
},
|
|
169132
|
+
{
|
|
169133
|
+
"chartId": "FcFcPlot-819",
|
|
169134
|
+
"lang": "r",
|
|
169135
|
+
"code": "# Load the PBMC marker gene table\ndata(\"pbmc.markers\")\n\n# Marker statistics of the two monocyte subsets\ncd14 <- pbmc.markers |>\n filter(cluster == \"CD14+ Mono\") |>\n select(gene, avg_log2FC, p_val_adj)\n\nfcgr3a <- pbmc.markers |>\n filter(cluster == \"FCGR3A+ Mono\") |>\n select(gene, avg_log2FC, p_val_adj)\n\n# Join by gene: 546 genes are markers in both subsets\nfc_fc <- inner_join(cd14, fcgr3a, by = \"gene\", suffix = c(\"_cd14\", \"_fcgr3a\"))\n\n# Classify each gene and compute the plotting score\nfc_cut <- 0.5\np_cut <- 0.05\nfc_fc <- fc_fc |>\n mutate(\n sig_cd14 = p_val_adj_cd14 < p_cut & abs(avg_log2FC_cd14) >= fc_cut,\n sig_fcgr3a = p_val_adj_fcgr3a < p_cut & abs(avg_log2FC_fcgr3a) >= fc_cut,\n category = case_when(\n sig_cd14 & sig_fcgr3a & sign(avg_log2FC_cd14) == sign(avg_log2FC_fcgr3a) ~ \"Shared marker\",\n sig_cd14 & sig_fcgr3a ~ \"Discordant\",\n sig_cd14 ~ \"CD14+ Mono-specific\",\n sig_fcgr3a ~ \"FCGR3A+ Mono-specific\",\n TRUE ~ \"Not significant\"\n ),\n neglog10p = -log10(pmax(p_val_adj_cd14, p_val_adj_fcgr3a))\n )\n\n# View data\nhead(fc_fc)",
|
|
169136
|
+
"packages": [
|
|
169137
|
+
"ggrepel",
|
|
169138
|
+
"scRNAtoolVis",
|
|
169139
|
+
"tidyverse"
|
|
169140
|
+
],
|
|
169141
|
+
"dataUrls": [],
|
|
169142
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169143
|
+
},
|
|
169144
|
+
{
|
|
169145
|
+
"chartId": "FcFcPlot-819",
|
|
169146
|
+
"lang": "r",
|
|
169147
|
+
"code": "ggplot(fc_fc, aes(avg_log2FC_cd14, avg_log2FC_fcgr3a)) +\n geom_hline(yintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_vline(xintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_abline(slope = 1, intercept = 0, linetype = \"dotted\", color = \"grey60\") +\n geom_point(color = \"#2166AC\", size = 1.8, alpha = 0.7) +\n labs(x = expression(log[2]*FC~\"(CD14+ Mono vs rest)\"),\n y = expression(log[2]*FC~\"(FCGR3A+ Mono vs rest)\")) +\n theme_bw()",
|
|
169148
|
+
"packages": [
|
|
169149
|
+
"ggrepel",
|
|
169150
|
+
"scRNAtoolVis",
|
|
169151
|
+
"tidyverse"
|
|
169152
|
+
],
|
|
169153
|
+
"dataUrls": [],
|
|
169154
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169155
|
+
},
|
|
169156
|
+
{
|
|
169157
|
+
"chartId": "FcFcPlot-819",
|
|
169158
|
+
"lang": "r",
|
|
169159
|
+
"code": "category_colors <- c(\n \"Shared marker\" = \"#B2182B\",\n \"Discordant\" = \"#7B3294\",\n \"CD14+ Mono-specific\" = \"#2166AC\",\n \"FCGR3A+ Mono-specific\" = \"#1B9E77\",\n \"Not significant\" = \"grey70\"\n)\n\nggplot(fc_fc, aes(avg_log2FC_cd14, avg_log2FC_fcgr3a)) +\n geom_hline(yintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_vline(xintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_point(aes(color = category), size = 2, alpha = 0.75) +\n scale_color_manual(values = category_colors) +\n labs(x = expression(log[2]*FC~\"(CD14+ Mono vs rest)\"),\n y = expression(log[2]*FC~\"(FCGR3A+ Mono vs rest)\"),\n color = \"Category\") +\n theme_bw()",
|
|
169160
|
+
"packages": [
|
|
169161
|
+
"ggrepel",
|
|
169162
|
+
"scRNAtoolVis",
|
|
169163
|
+
"tidyverse"
|
|
169164
|
+
],
|
|
169165
|
+
"dataUrls": [],
|
|
169166
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169167
|
+
},
|
|
169168
|
+
{
|
|
169169
|
+
"chartId": "FcFcPlot-819",
|
|
169170
|
+
"lang": "r",
|
|
169171
|
+
"code": "# Curated label set: discordant genes, extremes on both axes and top shared markers\nlabel_genes <- bind_rows(\n fc_fc |> filter(category == \"Discordant\") |>\n slice_max(abs(avg_log2FC_cd14 - avg_log2FC_fcgr3a), n = 3),\n fc_fc |> slice_max(abs(avg_log2FC_cd14), n = 3),\n fc_fc |> slice_max(abs(avg_log2FC_fcgr3a), n = 3),\n fc_fc |> filter(gene == \"MS4A7\"),\n fc_fc |> filter(category == \"Shared marker\") |>\n slice_max(neglog10p + pmin(abs(avg_log2FC_cd14), abs(avg_log2FC_fcgr3a)), n = 6)\n) |>\n distinct(gene, .keep_all = TRUE)\n\nggplot(fc_fc, aes(avg_log2FC_cd14, avg_log2FC_fcgr3a)) +\n geom_hline(yintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_vline(xintercept = c(-fc_cut, fc_cut), linetype = \"dashed\", color = \"grey50\") +\n geom_abline(slope = 1, intercept = 0, linetype = \"dotted\", color = \"grey60\") +\n geom_point(aes(color = category, size = neglog10p), alpha = 0.75) +\n scale_color_manual(values = category_colors) +\n scale_size_continuous(range = c(0.8, 5), name = expression(-log[10](P[adj]))) +\n geom_text_repel(data = label_genes, aes(label = gene, color = category),\n size = 3.1, fontface = \"italic\", max.overlaps = 40,\n box.padding = 0.55, segment.size = 0.25,\n show.legend = FALSE, seed = 1) +\n labs(x = expression(log[2]*FC~\"(CD14+ Mono vs rest)\"),\n y = expression(log[2]*FC~\"(FCGR3A+ Mono vs rest)\"),\n color = \"Category\") +\n theme_bw()",
|
|
169172
|
+
"packages": [
|
|
169173
|
+
"ggrepel",
|
|
169174
|
+
"scRNAtoolVis",
|
|
169175
|
+
"tidyverse"
|
|
169176
|
+
],
|
|
169177
|
+
"dataUrls": [],
|
|
169178
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/FcFcPlot.html"
|
|
169179
|
+
},
|
|
169180
|
+
{
|
|
169181
|
+
"chartId": "MutationOncoplot-820",
|
|
169182
|
+
"lang": "r",
|
|
169183
|
+
"code": "set.seed(2026)\n\ngenes <- c(\"TP53\", \"EGFR\", \"KRAS\", \"STK11\", \"KEAP1\", \"PIK3CA\", \"PTEN\", \"RB1\",\n \"APC\", \"ARID1A\", \"NF1\", \"NOTCH1\", \"BRAF\", \"CDKN2A\", \"SMAD4\", \"FBXW7\",\n \"ATM\", \"BRCA2\", \"ERBB2\", \"MET\")\ncohort <- rep(c(\"Subtype A\", \"Subtype B\"), c(35, 25))\nsamples <- sprintf(\"S%02d\", 1:60)\n\n# Subtype-specific mutation probabilities per gene\np_a <- c(.52, .34, .10, .14, .10, .10, .12, .10, .06, .22, .08, .06, .04, .10, .05, .06, .06, .05, .05, .04)\np_b <- c(.22, .08, .42, .40, .36, .14, .10, .10, .10, .06, .10, .06, .06, .10, .10, .08, .05, .05, .06, .08)\nmut_types <- c(\"Missense\", \"Nonsense\", \"Frameshift\", \"Splice_Site\", \"In_Frame\")\ntype_p <- c(.58, .14, .12, .08, .08)\n\nmutations <- map_dfr(seq_along(samples), function(i) {\n p <- if (cohort[i] == \"Subtype A\") p_a else p_b\n hit <- genes[runif(length(genes)) < p]\n if (length(hit) == 0) return(NULL)\n type <- sample(mut_types, length(hit), replace = TRUE, prob = type_p)\n # Tumor suppressors such as TP53 can receive a second hit, shown as Multi_Hit\n if (runif(1) < .15 && \"TP53\" %in% hit) {\n type[hit == \"TP53\"] <- \"Multi_Hit\"\n }\n tibble(sample = samples[i], gene = hit, type = type)\n})\n\nhead(mutations)",
|
|
169184
|
+
"packages": [
|
|
169185
|
+
"ComplexHeatmap",
|
|
169186
|
+
"tidyverse"
|
|
169187
|
+
],
|
|
169188
|
+
"dataUrls": [],
|
|
169189
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169190
|
+
},
|
|
169191
|
+
{
|
|
169192
|
+
"chartId": "MutationOncoplot-820",
|
|
169193
|
+
"lang": "r",
|
|
169194
|
+
"code": "# Reshape the mutation table into a gene x sample matrix; a cell holds one or\n# several alteration types separated by \";\"\ngene_levels <- names(sort(table(factor(mutations$gene, levels = genes)), decreasing = TRUE))\nmat <- matrix(\"\", nrow = length(genes), ncol = length(samples),\n dimnames = list(genes, samples))\nfor (i in seq_len(nrow(mutations))) {\n cell <- mat[mutations$gene[i], mutations$sample[i]]\n mat[mutations$gene[i], mutations$sample[i]] <-\n if (cell == \"\") mutations$type[i] else paste(cell, mutations$type[i], sep = \";\")\n}\n\n# Order samples: by subtype, then by mutation count (waterfall look)\nmut_count <- colSums(mat != \"\")\nord <- order(factor(cohort, levels = c(\"Subtype A\", \"Subtype B\")), -mut_count)\nmat <- mat[gene_levels, ord]\n\n# Annotation vectors aligned with the reordered matrix\ncohort_ordered <- factor(cohort[ord], levels = c(\"Subtype A\", \"Subtype B\"))\ntmb <- mut_count[ord]\n\n# Colors for alteration types\nmutation_colors <- c(\n Missense = \"#3690C0\", Nonsense = \"#A50F15\", Frameshift = \"#F16913\",\n Splice_Site = \"#6A51A3\", In_Frame = \"#31A354\", Multi_Hit = \"#252525\"\n)\n\n# One drawing function per alteration type\nrect_fun <- function(color) {\n function(x, y, w, h) grid.rect(x, y, w * 0.9, h * 0.9, gp = gpar(fill = color, col = NA))\n}\nalter_fun <- list(\n background = rect_fun(\"#F2F2F2\"),\n Missense = rect_fun(mutation_colors[\"Missense\"]),\n Nonsense = rect_fun(mutation_colors[\"Nonsense\"]),\n Frameshift = rect_fun(mutation_colors[\"Frameshift\"]),\n Splice_Site = rect_fun(mutation_colors[\"Splice_Site\"]),\n In_Frame = rect_fun(mutation_colors[\"In_Frame\"]),\n Multi_Hit = rect_fun(mutation_colors[\"Multi_Hit\"])\n)",
|
|
169195
|
+
"packages": [
|
|
169196
|
+
"ComplexHeatmap",
|
|
169197
|
+
"tidyverse"
|
|
169198
|
+
],
|
|
169199
|
+
"dataUrls": [],
|
|
169200
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169201
|
+
},
|
|
169202
|
+
{
|
|
169203
|
+
"chartId": "MutationOncoplot-820",
|
|
169204
|
+
"lang": "r",
|
|
169205
|
+
"code": "p1 <- oncoPrint(mat,\n alter_fun = alter_fun, alter_fun_is_vectorized = FALSE, col = mutation_colors,\n column_order = samples[ord], show_column_names = FALSE,\n row_names_gp = gpar(fontsize = 9, fontface = \"italic\"), pct_gp = gpar(fontsize = 8),\n heatmap_legend_param = list(title = \"Mutation type\"))\ndraw(p1)",
|
|
169206
|
+
"packages": [
|
|
169207
|
+
"ComplexHeatmap",
|
|
169208
|
+
"tidyverse"
|
|
169209
|
+
],
|
|
169210
|
+
"dataUrls": [],
|
|
169211
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169212
|
+
},
|
|
169213
|
+
{
|
|
169214
|
+
"chartId": "MutationOncoplot-820",
|
|
169215
|
+
"lang": "r",
|
|
169216
|
+
"code": "top_annotation <- HeatmapAnnotation(\n TMB = anno_barplot(tmb, height = unit(1.1, \"cm\"),\n gp = gpar(fill = \"#6A51A3\", col = NA)),\n annotation_name_gp = gpar(fontsize = 9))\n\np2 <- oncoPrint(mat,\n alter_fun = alter_fun, alter_fun_is_vectorized = FALSE, col = mutation_colors,\n column_order = samples[ord], show_column_names = FALSE,\n column_split = cohort_ordered, column_title_gp = gpar(fontsize = 10, fontface = \"bold\"),\n top_annotation = top_annotation,\n bottom_annotation = HeatmapAnnotation(\n Subtype = as.character(cohort_ordered),\n col = list(Subtype = c(\"Subtype A\" = \"#E08214\", \"Subtype B\" = \"#5E3C99\")),\n annotation_name_side = \"left\", annotation_name_gp = gpar(fontsize = 9)),\n row_names_gp = gpar(fontsize = 9, fontface = \"italic\"), pct_gp = gpar(fontsize = 8),\n heatmap_legend_param = list(title = \"Mutation type\"))\ndraw(p2)",
|
|
169217
|
+
"packages": [
|
|
169218
|
+
"ComplexHeatmap",
|
|
169219
|
+
"tidyverse"
|
|
169220
|
+
],
|
|
169221
|
+
"dataUrls": [],
|
|
169222
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169223
|
+
},
|
|
169224
|
+
{
|
|
169225
|
+
"chartId": "MutationOncoplot-820",
|
|
169226
|
+
"lang": "r",
|
|
169227
|
+
"code": "pathway <- c(\n TP53 = \"p53\", RB1 = \"p53\", CDKN2A = \"p53\",\n EGFR = \"RTK/RAS\", ERBB2 = \"RTK/RAS\", MET = \"RTK/RAS\", KRAS = \"RTK/RAS\",\n BRAF = \"RTK/RAS\", NF1 = \"RTK/RAS\",\n PIK3CA = \"PI3K\", PTEN = \"PI3K\", STK11 = \"PI3K\", KEAP1 = \"PI3K\",\n APC = \"WNT/Notch\", NOTCH1 = \"WNT/Notch\", FBXW7 = \"WNT/Notch\",\n ARID1A = \"Chromatin\", SMAD4 = \"TGF-beta\", ATM = \"DDR\", BRCA2 = \"DDR\")\npathway_levels <- c(\"RTK/RAS\", \"PI3K\", \"p53\", \"WNT/Notch\", \"Chromatin\", \"TGF-beta\", \"DDR\")\n\np3 <- oncoPrint(mat,\n alter_fun = alter_fun, alter_fun_is_vectorized = FALSE, col = mutation_colors,\n column_order = samples[ord], show_column_names = FALSE,\n row_split = factor(pathway[gene_levels], levels = pathway_levels),\n row_title_gp = gpar(fontsize = 9, fontface = \"bold\"), row_title_rot = 0,\n column_split = cohort_ordered, column_title_gp = gpar(fontsize = 10, fontface = \"bold\"),\n top_annotation = top_annotation,\n row_names_gp = gpar(fontsize = 9, fontface = \"italic\"), pct_gp = gpar(fontsize = 8),\n heatmap_legend_param = list(title = \"Mutation type\"))\ndraw(p3)",
|
|
169228
|
+
"packages": [
|
|
169229
|
+
"ComplexHeatmap",
|
|
169230
|
+
"tidyverse"
|
|
169231
|
+
],
|
|
169232
|
+
"dataUrls": [],
|
|
169233
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169234
|
+
},
|
|
169235
|
+
{
|
|
169236
|
+
"chartId": "MutationOncoplot-821",
|
|
169237
|
+
"lang": "r",
|
|
169238
|
+
"code": "set.seed(2026)\n\ngenes <- c(\"TP53\", \"EGFR\", \"KRAS\", \"STK11\", \"KEAP1\", \"PIK3CA\", \"PTEN\", \"RB1\",\n \"APC\", \"ARID1A\", \"NF1\", \"NOTCH1\", \"BRAF\", \"CDKN2A\", \"SMAD4\", \"FBXW7\",\n \"ATM\", \"BRCA2\", \"ERBB2\", \"MET\")\ncohort <- rep(c(\"Subtype A\", \"Subtype B\"), c(35, 25))\nsamples <- sprintf(\"S%02d\", 1:60)\n\n# Subtype-specific mutation probabilities per gene\np_a <- c(.52, .34, .10, .14, .10, .10, .12, .10, .06, .22, .08, .06, .04, .10, .05, .06, .06, .05, .05, .04)\np_b <- c(.22, .08, .42, .40, .36, .14, .10, .10, .10, .06, .10, .06, .06, .10, .10, .08, .05, .05, .06, .08)\nmut_types <- c(\"Missense\", \"Nonsense\", \"Frameshift\", \"Splice_Site\", \"In_Frame\")\ntype_p <- c(.58, .14, .12, .08, .08)\n\nmutations <- map_dfr(seq_along(samples), function(i) {\n p <- if (cohort[i] == \"Subtype A\") p_a else p_b\n hit <- genes[runif(length(genes)) < p]\n if (length(hit) == 0) return(NULL)\n type <- sample(mut_types, length(hit), replace = TRUE, prob = type_p)\n # Tumor suppressors such as TP53 can receive a second hit, shown as Multi_Hit\n if (runif(1) < .15 && \"TP53\" %in% hit) {\n type[hit == \"TP53\"] <- \"Multi_Hit\"\n }\n tibble(sample = samples[i], gene = hit, type = type)\n})\n\nhead(mutations)",
|
|
169239
|
+
"packages": [
|
|
169240
|
+
"ComplexHeatmap",
|
|
169241
|
+
"tidyverse"
|
|
169242
|
+
],
|
|
169243
|
+
"dataUrls": [],
|
|
169244
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169245
|
+
},
|
|
169246
|
+
{
|
|
169247
|
+
"chartId": "MutationOncoplot-821",
|
|
169248
|
+
"lang": "r",
|
|
169249
|
+
"code": "# Reshape the mutation table into a gene x sample matrix; a cell holds one or\n# several alteration types separated by \";\"\ngene_levels <- names(sort(table(factor(mutations$gene, levels = genes)), decreasing = TRUE))\nmat <- matrix(\"\", nrow = length(genes), ncol = length(samples),\n dimnames = list(genes, samples))\nfor (i in seq_len(nrow(mutations))) {\n cell <- mat[mutations$gene[i], mutations$sample[i]]\n mat[mutations$gene[i], mutations$sample[i]] <-\n if (cell == \"\") mutations$type[i] else paste(cell, mutations$type[i], sep = \";\")\n}\n\n# Order samples: by subtype, then by mutation count (waterfall look)\nmut_count <- colSums(mat != \"\")\nord <- order(factor(cohort, levels = c(\"Subtype A\", \"Subtype B\")), -mut_count)\nmat <- mat[gene_levels, ord]\n\n# Annotation vectors aligned with the reordered matrix\ncohort_ordered <- factor(cohort[ord], levels = c(\"Subtype A\", \"Subtype B\"))\ntmb <- mut_count[ord]\n\n# Colors for alteration types\nmutation_colors <- c(\n Missense = \"#3690C0\", Nonsense = \"#A50F15\", Frameshift = \"#F16913\",\n Splice_Site = \"#6A51A3\", In_Frame = \"#31A354\", Multi_Hit = \"#252525\"\n)\n\n# One drawing function per alteration type\nrect_fun <- function(color) {\n function(x, y, w, h) grid.rect(x, y, w * 0.9, h * 0.9, gp = gpar(fill = color, col = NA))\n}\nalter_fun <- list(\n background = rect_fun(\"#F2F2F2\"),\n Missense = rect_fun(mutation_colors[\"Missense\"]),\n Nonsense = rect_fun(mutation_colors[\"Nonsense\"]),\n Frameshift = rect_fun(mutation_colors[\"Frameshift\"]),\n Splice_Site = rect_fun(mutation_colors[\"Splice_Site\"]),\n In_Frame = rect_fun(mutation_colors[\"In_Frame\"]),\n Multi_Hit = rect_fun(mutation_colors[\"Multi_Hit\"])\n)",
|
|
169250
|
+
"packages": [
|
|
169251
|
+
"ComplexHeatmap",
|
|
169252
|
+
"tidyverse"
|
|
169253
|
+
],
|
|
169254
|
+
"dataUrls": [],
|
|
169255
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169256
|
+
},
|
|
169257
|
+
{
|
|
169258
|
+
"chartId": "MutationOncoplot-821",
|
|
169259
|
+
"lang": "r",
|
|
169260
|
+
"code": "p1 <- oncoPrint(mat,\n alter_fun = alter_fun, alter_fun_is_vectorized = FALSE, col = mutation_colors,\n column_order = samples[ord], show_column_names = FALSE,\n row_names_gp = gpar(fontsize = 9, fontface = \"italic\"), pct_gp = gpar(fontsize = 8),\n heatmap_legend_param = list(title = \"Mutation type\"))\ndraw(p1)",
|
|
169261
|
+
"packages": [
|
|
169262
|
+
"ComplexHeatmap",
|
|
169263
|
+
"tidyverse"
|
|
169264
|
+
],
|
|
169265
|
+
"dataUrls": [],
|
|
169266
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169267
|
+
},
|
|
169268
|
+
{
|
|
169269
|
+
"chartId": "MutationOncoplot-821",
|
|
169270
|
+
"lang": "r",
|
|
169271
|
+
"code": "top_annotation <- HeatmapAnnotation(\n TMB = anno_barplot(tmb, height = unit(1.1, \"cm\"),\n gp = gpar(fill = \"#6A51A3\", col = NA)),\n annotation_name_gp = gpar(fontsize = 9))\n\np2 <- oncoPrint(mat,\n alter_fun = alter_fun, alter_fun_is_vectorized = FALSE, col = mutation_colors,\n column_order = samples[ord], show_column_names = FALSE,\n column_split = cohort_ordered, column_title_gp = gpar(fontsize = 10, fontface = \"bold\"),\n top_annotation = top_annotation,\n bottom_annotation = HeatmapAnnotation(\n Subtype = as.character(cohort_ordered),\n col = list(Subtype = c(\"Subtype A\" = \"#E08214\", \"Subtype B\" = \"#5E3C99\")),\n annotation_name_side = \"left\", annotation_name_gp = gpar(fontsize = 9)),\n row_names_gp = gpar(fontsize = 9, fontface = \"italic\"), pct_gp = gpar(fontsize = 8),\n heatmap_legend_param = list(title = \"Mutation type\"))\ndraw(p2)",
|
|
169272
|
+
"packages": [
|
|
169273
|
+
"ComplexHeatmap",
|
|
169274
|
+
"tidyverse"
|
|
169275
|
+
],
|
|
169276
|
+
"dataUrls": [],
|
|
169277
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169278
|
+
},
|
|
169279
|
+
{
|
|
169280
|
+
"chartId": "MutationOncoplot-821",
|
|
169281
|
+
"lang": "r",
|
|
169282
|
+
"code": "pathway <- c(\n TP53 = \"p53\", RB1 = \"p53\", CDKN2A = \"p53\",\n EGFR = \"RTK/RAS\", ERBB2 = \"RTK/RAS\", MET = \"RTK/RAS\", KRAS = \"RTK/RAS\",\n BRAF = \"RTK/RAS\", NF1 = \"RTK/RAS\",\n PIK3CA = \"PI3K\", PTEN = \"PI3K\", STK11 = \"PI3K\", KEAP1 = \"PI3K\",\n APC = \"WNT/Notch\", NOTCH1 = \"WNT/Notch\", FBXW7 = \"WNT/Notch\",\n ARID1A = \"Chromatin\", SMAD4 = \"TGF-beta\", ATM = \"DDR\", BRCA2 = \"DDR\")\npathway_levels <- c(\"RTK/RAS\", \"PI3K\", \"p53\", \"WNT/Notch\", \"Chromatin\", \"TGF-beta\", \"DDR\")\n\np3 <- oncoPrint(mat,\n alter_fun = alter_fun, alter_fun_is_vectorized = FALSE, col = mutation_colors,\n column_order = samples[ord], show_column_names = FALSE,\n row_split = factor(pathway[gene_levels], levels = pathway_levels),\n row_title_gp = gpar(fontsize = 9, fontface = \"bold\"), row_title_rot = 0,\n column_split = cohort_ordered, column_title_gp = gpar(fontsize = 10, fontface = \"bold\"),\n top_annotation = top_annotation,\n row_names_gp = gpar(fontsize = 9, fontface = \"italic\"), pct_gp = gpar(fontsize = 8),\n heatmap_legend_param = list(title = \"Mutation type\"))\ndraw(p3)",
|
|
169283
|
+
"packages": [
|
|
169284
|
+
"ComplexHeatmap",
|
|
169285
|
+
"tidyverse"
|
|
169286
|
+
],
|
|
169287
|
+
"dataUrls": [],
|
|
169288
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169289
|
+
},
|
|
169290
|
+
{
|
|
169291
|
+
"chartId": "MutationOncoplot-822",
|
|
169292
|
+
"lang": "r",
|
|
169293
|
+
"code": "set.seed(2026)\n\ngenes <- c(\"TP53\", \"EGFR\", \"KRAS\", \"STK11\", \"KEAP1\", \"PIK3CA\", \"PTEN\", \"RB1\",\n \"APC\", \"ARID1A\", \"NF1\", \"NOTCH1\", \"BRAF\", \"CDKN2A\", \"SMAD4\", \"FBXW7\",\n \"ATM\", \"BRCA2\", \"ERBB2\", \"MET\")\ncohort <- rep(c(\"Subtype A\", \"Subtype B\"), c(35, 25))\nsamples <- sprintf(\"S%02d\", 1:60)\n\n# Subtype-specific mutation probabilities per gene\np_a <- c(.52, .34, .10, .14, .10, .10, .12, .10, .06, .22, .08, .06, .04, .10, .05, .06, .06, .05, .05, .04)\np_b <- c(.22, .08, .42, .40, .36, .14, .10, .10, .10, .06, .10, .06, .06, .10, .10, .08, .05, .05, .06, .08)\nmut_types <- c(\"Missense\", \"Nonsense\", \"Frameshift\", \"Splice_Site\", \"In_Frame\")\ntype_p <- c(.58, .14, .12, .08, .08)\n\nmutations <- map_dfr(seq_along(samples), function(i) {\n p <- if (cohort[i] == \"Subtype A\") p_a else p_b\n hit <- genes[runif(length(genes)) < p]\n if (length(hit) == 0) return(NULL)\n type <- sample(mut_types, length(hit), replace = TRUE, prob = type_p)\n # Tumor suppressors such as TP53 can receive a second hit, shown as Multi_Hit\n if (runif(1) < .15 && \"TP53\" %in% hit) {\n type[hit == \"TP53\"] <- \"Multi_Hit\"\n }\n tibble(sample = samples[i], gene = hit, type = type)\n})\n\nhead(mutations)",
|
|
169294
|
+
"packages": [
|
|
169295
|
+
"ComplexHeatmap",
|
|
169296
|
+
"tidyverse"
|
|
169297
|
+
],
|
|
169298
|
+
"dataUrls": [],
|
|
169299
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169300
|
+
},
|
|
169301
|
+
{
|
|
169302
|
+
"chartId": "MutationOncoplot-822",
|
|
169303
|
+
"lang": "r",
|
|
169304
|
+
"code": "# Reshape the mutation table into a gene x sample matrix; a cell holds one or\n# several alteration types separated by \";\"\ngene_levels <- names(sort(table(factor(mutations$gene, levels = genes)), decreasing = TRUE))\nmat <- matrix(\"\", nrow = length(genes), ncol = length(samples),\n dimnames = list(genes, samples))\nfor (i in seq_len(nrow(mutations))) {\n cell <- mat[mutations$gene[i], mutations$sample[i]]\n mat[mutations$gene[i], mutations$sample[i]] <-\n if (cell == \"\") mutations$type[i] else paste(cell, mutations$type[i], sep = \";\")\n}\n\n# Order samples: by subtype, then by mutation count (waterfall look)\nmut_count <- colSums(mat != \"\")\nord <- order(factor(cohort, levels = c(\"Subtype A\", \"Subtype B\")), -mut_count)\nmat <- mat[gene_levels, ord]\n\n# Annotation vectors aligned with the reordered matrix\ncohort_ordered <- factor(cohort[ord], levels = c(\"Subtype A\", \"Subtype B\"))\ntmb <- mut_count[ord]\n\n# Colors for alteration types\nmutation_colors <- c(\n Missense = \"#3690C0\", Nonsense = \"#A50F15\", Frameshift = \"#F16913\",\n Splice_Site = \"#6A51A3\", In_Frame = \"#31A354\", Multi_Hit = \"#252525\"\n)\n\n# One drawing function per alteration type\nrect_fun <- function(color) {\n function(x, y, w, h) grid.rect(x, y, w * 0.9, h * 0.9, gp = gpar(fill = color, col = NA))\n}\nalter_fun <- list(\n background = rect_fun(\"#F2F2F2\"),\n Missense = rect_fun(mutation_colors[\"Missense\"]),\n Nonsense = rect_fun(mutation_colors[\"Nonsense\"]),\n Frameshift = rect_fun(mutation_colors[\"Frameshift\"]),\n Splice_Site = rect_fun(mutation_colors[\"Splice_Site\"]),\n In_Frame = rect_fun(mutation_colors[\"In_Frame\"]),\n Multi_Hit = rect_fun(mutation_colors[\"Multi_Hit\"])\n)",
|
|
169305
|
+
"packages": [
|
|
169306
|
+
"ComplexHeatmap",
|
|
169307
|
+
"tidyverse"
|
|
169308
|
+
],
|
|
169309
|
+
"dataUrls": [],
|
|
169310
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169311
|
+
},
|
|
169312
|
+
{
|
|
169313
|
+
"chartId": "MutationOncoplot-822",
|
|
169314
|
+
"lang": "r",
|
|
169315
|
+
"code": "p1 <- oncoPrint(mat,\n alter_fun = alter_fun, alter_fun_is_vectorized = FALSE, col = mutation_colors,\n column_order = samples[ord], show_column_names = FALSE,\n row_names_gp = gpar(fontsize = 9, fontface = \"italic\"), pct_gp = gpar(fontsize = 8),\n heatmap_legend_param = list(title = \"Mutation type\"))\ndraw(p1)",
|
|
169316
|
+
"packages": [
|
|
169317
|
+
"ComplexHeatmap",
|
|
169318
|
+
"tidyverse"
|
|
169319
|
+
],
|
|
169320
|
+
"dataUrls": [],
|
|
169321
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169322
|
+
},
|
|
169323
|
+
{
|
|
169324
|
+
"chartId": "MutationOncoplot-822",
|
|
169325
|
+
"lang": "r",
|
|
169326
|
+
"code": "top_annotation <- HeatmapAnnotation(\n TMB = anno_barplot(tmb, height = unit(1.1, \"cm\"),\n gp = gpar(fill = \"#6A51A3\", col = NA)),\n annotation_name_gp = gpar(fontsize = 9))\n\np2 <- oncoPrint(mat,\n alter_fun = alter_fun, alter_fun_is_vectorized = FALSE, col = mutation_colors,\n column_order = samples[ord], show_column_names = FALSE,\n column_split = cohort_ordered, column_title_gp = gpar(fontsize = 10, fontface = \"bold\"),\n top_annotation = top_annotation,\n bottom_annotation = HeatmapAnnotation(\n Subtype = as.character(cohort_ordered),\n col = list(Subtype = c(\"Subtype A\" = \"#E08214\", \"Subtype B\" = \"#5E3C99\")),\n annotation_name_side = \"left\", annotation_name_gp = gpar(fontsize = 9)),\n row_names_gp = gpar(fontsize = 9, fontface = \"italic\"), pct_gp = gpar(fontsize = 8),\n heatmap_legend_param = list(title = \"Mutation type\"))\ndraw(p2)",
|
|
169327
|
+
"packages": [
|
|
169328
|
+
"ComplexHeatmap",
|
|
169329
|
+
"tidyverse"
|
|
169330
|
+
],
|
|
169331
|
+
"dataUrls": [],
|
|
169332
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
169333
|
+
},
|
|
169334
|
+
{
|
|
169335
|
+
"chartId": "MutationOncoplot-822",
|
|
169336
|
+
"lang": "r",
|
|
169337
|
+
"code": "pathway <- c(\n TP53 = \"p53\", RB1 = \"p53\", CDKN2A = \"p53\",\n EGFR = \"RTK/RAS\", ERBB2 = \"RTK/RAS\", MET = \"RTK/RAS\", KRAS = \"RTK/RAS\",\n BRAF = \"RTK/RAS\", NF1 = \"RTK/RAS\",\n PIK3CA = \"PI3K\", PTEN = \"PI3K\", STK11 = \"PI3K\", KEAP1 = \"PI3K\",\n APC = \"WNT/Notch\", NOTCH1 = \"WNT/Notch\", FBXW7 = \"WNT/Notch\",\n ARID1A = \"Chromatin\", SMAD4 = \"TGF-beta\", ATM = \"DDR\", BRCA2 = \"DDR\")\npathway_levels <- c(\"RTK/RAS\", \"PI3K\", \"p53\", \"WNT/Notch\", \"Chromatin\", \"TGF-beta\", \"DDR\")\n\np3 <- oncoPrint(mat,\n alter_fun = alter_fun, alter_fun_is_vectorized = FALSE, col = mutation_colors,\n column_order = samples[ord], show_column_names = FALSE,\n row_split = factor(pathway[gene_levels], levels = pathway_levels),\n row_title_gp = gpar(fontsize = 9, fontface = \"bold\"), row_title_rot = 0,\n column_split = cohort_ordered, column_title_gp = gpar(fontsize = 10, fontface = \"bold\"),\n top_annotation = top_annotation,\n row_names_gp = gpar(fontsize = 9, fontface = \"italic\"), pct_gp = gpar(fontsize = 8),\n heatmap_legend_param = list(title = \"Mutation type\"))\ndraw(p3)",
|
|
169338
|
+
"packages": [
|
|
169339
|
+
"ComplexHeatmap",
|
|
169340
|
+
"tidyverse"
|
|
169341
|
+
],
|
|
169342
|
+
"dataUrls": [],
|
|
169343
|
+
"sourceAnchor": "https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html"
|
|
168935
169344
|
}
|
|
168936
169345
|
],
|
|
168937
169346
|
"keywords": {
|
|
@@ -170370,8 +170779,8 @@
|
|
|
170370
170779
|
},
|
|
170371
170780
|
"citation": {
|
|
170372
170781
|
"paperDoi": "10.1002/imm3.70038",
|
|
170373
|
-
"paperUrl": "https://
|
|
170374
|
-
"bibtex": "@article{
|
|
170782
|
+
"paperUrl": "https://doi.org/10.1002/imm3.70038",
|
|
170783
|
+
"bibtex": "@article{li2026bizard,\n title={Bizard: A Community-Driven Platform for Accelerating and Enhancing Biomedical Data Visualization},\n author={Li, Kexin and Zheng, Hu and Huang, Kexin and others},\n journal={iMetaMed},\n year={2026},\n pages={e70038},\n doi={10.1002/imm3.70038}\n}",
|
|
170375
170784
|
"license": "CC-BY-NC-4.0"
|
|
170376
170785
|
}
|
|
170377
170786
|
}
|
package/dist/snapshot/llms.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Bizard
|
|
2
2
|
|
|
3
3
|
> An open atlas of biomedical data visualization tutorials (R/Python/Julia).
|
|
4
|
-
> License: CC-BY-NC-4.0. Paper: https://
|
|
4
|
+
> License: CC-BY-NC-4.0. Paper: https://doi.org/10.1002/imm3.70038
|
|
5
5
|
|
|
6
6
|
## Animation (动画)
|
|
7
7
|
- [Scattered Bubble Animation](https://openbiox.github.io/Bizard/Animation/Animation.html#taking-the-gapminder-dataset-as-an-example)
|
|
@@ -514,6 +514,11 @@
|
|
|
514
514
|
- [English Calendar](https://openbiox.github.io/Bizard/DataOverTime/CalendHighlight.html#english-calendar)
|
|
515
515
|
- [Calendar Period](https://openbiox.github.io/Bizard/DataOverTime/CalendHighlight.html#calendar-period)
|
|
516
516
|
|
|
517
|
+
## FcFcPlot
|
|
518
|
+
- [Basic FC-FC Scatter Plot](https://openbiox.github.io/Bizard/Omics/FcFcPlot.html#fig-1.1BasicFcFc)
|
|
519
|
+
- [Color points by significance category](https://openbiox.github.io/Bizard/Omics/FcFcPlot.html#fig-1.2CategoryFcFc)
|
|
520
|
+
- [FC-FC scatter plot with significance-scaled points and curated gene labels](https://openbiox.github.io/Bizard/Omics/FcFcPlot.html#fig-1.3LabelFcFc)
|
|
521
|
+
|
|
517
522
|
## GeneStructurePlot
|
|
518
523
|
- [Gene Structure Plot](https://openbiox.github.io/Bizard/Omics/GeneStructurePlot.html#fig-1.1BasicPlot)
|
|
519
524
|
- [Gene Structure Plot](https://openbiox.github.io/Bizard/Omics/GeneStructurePlot.html#fig-1.2GeneGroup)
|
|
@@ -642,6 +647,11 @@
|
|
|
642
647
|
- [Direction Rotation of Multiple Volcano Plot](https://openbiox.github.io/Bizard/Omics/MultiVolcanoPlot.html#direction-of-rotation)
|
|
643
648
|
- [Polar Coordinates of Multiple Volcano Plot](https://openbiox.github.io/Bizard/Omics/MultiVolcanoPlot.html#polar-coordinates)
|
|
644
649
|
|
|
650
|
+
## MutationOncoplot
|
|
651
|
+
- [Basic Mutation Landscape Oncoplot](https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html#fig-1.1BasicOncoplot)
|
|
652
|
+
- [Oncoplot split by molecular subtype with mutation burden bars](https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html#fig-1.2CohortOncoplot)
|
|
653
|
+
- [Oncoplot with genes grouped by signaling pathway](https://openbiox.github.io/Bizard/Omics/MutationOncoplot.html#fig-1.3PathwayOncoplot)
|
|
654
|
+
|
|
645
655
|
## NetworkPlot
|
|
646
656
|
- [Build Network Plot](https://openbiox.github.io/Bizard/Omics/NetworkPlot.html#build-network)
|
|
647
657
|
- [Add Annotation to Nework Plot](https://openbiox.github.io/Bizard/Omics/NetworkPlot.html#add-annotation)
|
package/package.json
CHANGED