diff --git a/.github/scripts/generate_skills.py b/.github/scripts/generate_skills.py index c98e6026a..4072e9a61 100644 --- a/.github/scripts/generate_skills.py +++ b/.github/scripts/generate_skills.py @@ -270,8 +270,12 @@ def qmd_to_skill_offline(filepath: Path, base_url: str = DEFAULT_BASE_URL) -> Di tips = _generate_tips(content, language, category, headings, all_blocks) tips_text = "\n".join(f"- {t}" for t in tips) + # Build the skill title: strip any existing language tag from the QMD title to avoid + # duplication (e.g., QMD title "Scatter Plot (Python)" + "(Python)" = "Scatter Plot (Python) (Python)") + skill_title = re.sub(r'\s*\((R|Python|Julia)\)\s*$', '', title, flags=re.IGNORECASE).strip() + skill_text = ( - f"# Skill: {title} ({lang_display})\n\n" + f"# Skill: {skill_title} ({lang_display})\n\n" f"## Category\n{category}\n\n" f"## When to Use\n{use_when}\n\n" f"## Required {lang_display} Packages\n{pkg_list}\n\n" @@ -327,6 +331,11 @@ def _build_combined_code(content: str, language: str, packages: List[str]) -> st parts.append("# Load packages\n" + "\n".join(imp_lines)) elif language == 'julia': using_lines = [f"using {p}" for p in packages[:6]] + # Also add `using Random` if the code references Random functions but Random is not in packages + # (Random is in JULIA_STDLIB so it's excluded from packages list) + all_code = "\n".join(code for _, code in blocks) + if 'Random.' in all_code and 'Random' not in packages: + using_lines.append("using Random") if using_lines: parts.append("# Load packages\n" + "\n".join(using_lines)) @@ -411,14 +420,21 @@ def _extract_key_parameters(content: str, language: str, jl_params = { 'colormap': 'Color scheme for the plot (e.g., :viridis, :RdBu)', 'markersize': 'Size of scatter plot markers', - 'alpha': 'Transparency level (0โ€“1)', - 'color': 'Color of plot elements', + 'color': 'Color of plot elements (e.g., :steelblue or (:red, 0.5) for alpha)', 'linewidth': 'Width of lines in the plot', 'colorrange': 'Range for color mapping as (min, max) tuple', + 'alpha': 'Transparency level (0โ€“1) via color tuple (color, alpha)', + 'side': 'Side of violin to draw (:left, :right, or both)', + 'width': 'Width of violin or box plot elements', + 'bandwidth': 'Kernel bandwidth for density estimation in violin plots', + 'size': 'Figure size as (width, height) in pixels', } for param, desc in jl_params.items(): if param in combined_code and len(params) < 8: params[param] = desc + # Detect color tuple usage (alpha via tuple syntax) + if re.search(r'\(\s*:\w+\s*,\s*[\d.]+\s*\)', combined_code) and 'alpha' not in params and len(params) < 8: + params['alpha'] = 'Transparency via color tuple syntax: color=(:steelblue, 0.7)' # Ensure at least 3 params if len(params) < 3: @@ -430,9 +446,15 @@ def _extract_key_parameters(content: str, language: str, elif language == 'python': if 'figsize' not in params: params['figsize'] = 'Figure dimensions as (width, height) in inches' + if 'alpha' not in params: + params['alpha'] = 'Transparency level (0โ€“1)' elif language == 'julia': if 'color' not in params: - params['color'] = 'Color of plot elements' + params['color'] = 'Color of plot elements (e.g., :steelblue or (:red, 0.5) for alpha)' + if 'markersize' not in params: + params['markersize'] = 'Size of scatter plot markers' + if len(params) < 3 and 'size' not in params: + params['size'] = 'Figure size as (width, height) in pixels' return dict(list(params.items())[:8]) @@ -553,6 +575,10 @@ def generate_skill(self, filepath: Path, rel_html = str(filepath.with_suffix(".html")).lstrip("./") tutorial_url = base_url.rstrip("/") + "/" + rel_html + # Strip language tag from title for the skill header to avoid duplication + # (e.g., "Scatter Plot (Python)" becomes "Scatter Plot" before "(Python)" is appended) + skill_title = re.sub(r'\s*\((R|Python|Julia)\)\s*$', '', title, flags=re.IGNORECASE).strip() + system_prompt = f"""You are an expert at creating AI skill documents for biomedical visualization tutorials. Follow this specification exactly: @@ -572,7 +598,7 @@ def generate_skill(self, filepath: Path, user_prompt = f"""Convert this Bizard QMD tutorial into a skill document. **Tutorial metadata:** -- Title: {title} +- Title: {skill_title} - Language: {lang_display} - Category: {category} - Packages detected: {', '.join(packages) if packages else 'none detected'} diff --git a/GraphGallery.qmd b/GraphGallery.qmd index 1a763470a..cb5865a14 100644 --- a/GraphGallery.qmd +++ b/GraphGallery.qmd @@ -356,6 +356,80 @@ div( ) ``` +## ๐๐˜๐“๐‡๐Ž๐ + +```{r} +#| echo: false +data_PYTHON <- data[data$Level1=="PYTHON",] + +tbl <- reactable( + data_PYTHON, + defaultColDef = colDef(vAlign = "center", headerClass = "header"), + columns = list( + Id = colDef( + name = "Id", align = "center", minWidth = 70, maxWidth = 90 + ), + Name = colDef( + name = "Graph", cell = JS("renderGraph"), html = TRUE, minWidth = 250 + ), + Image_url = colDef(show = FALSE), + Tutorial_url = colDef(show = FALSE), + Description =colDef(show = FALSE), + Type = colDef(name = "Type"), + Level1 =colDef(show = FALSE), + Level2 =colDef(show = FALSE) + ), + searchable = TRUE, + defaultPageSize = 7 +) + +div( + class = "movies", + tbl, + div(id = "modal", class="modal", onclick="hideModal()", + img( + id="modal-image", class="modal-image" + )) +) +``` + +## ๐‰๐”๐‹๐ˆ๐€ + +```{r} +#| echo: false +data_JULIA <- data[data$Level1=="JULIA",] + +tbl <- reactable( + data_JULIA, + defaultColDef = colDef(vAlign = "center", headerClass = "header"), + columns = list( + Id = colDef( + name = "Id", align = "center", minWidth = 70, maxWidth = 90 + ), + Name = colDef( + name = "Graph", cell = JS("renderGraph"), html = TRUE, minWidth = 250 + ), + Image_url = colDef(show = FALSE), + Tutorial_url = colDef(show = FALSE), + Description =colDef(show = FALSE), + Type = colDef(name = "Type"), + Level1 =colDef(show = FALSE), + Level2 =colDef(show = FALSE) + ), + searchable = TRUE, + defaultPageSize = 7 +) + +div( + class = "movies", + tbl, + div(id = "modal", class="modal", onclick="hideModal()", + img( + id="modal-image", class="modal-image" + )) +) +``` + ## ๐‡๐ˆ๐๐‹๐Ž๐“ ### BASICS diff --git a/GraphGallery.zh.qmd b/GraphGallery.zh.qmd index a5f692c2c..d634822a3 100644 --- a/GraphGallery.zh.qmd +++ b/GraphGallery.zh.qmd @@ -356,6 +356,80 @@ div( ) ``` +## ๐๐˜๐“๐‡๐Ž๐ + +```{r} +#| echo: false +data_PYTHON <- data[data$Level1=="PYTHON",] + +tbl <- reactable( + data_PYTHON, + defaultColDef = colDef(vAlign = "center", headerClass = "header"), + columns = list( + Id = colDef( + name = "Id", align = "center", minWidth = 70, maxWidth = 90 + ), + Name = colDef( + name = "Graph", cell = JS("renderGraph"), html = TRUE, minWidth = 250 + ), + Image_url = colDef(show = FALSE), + Tutorial_url = colDef(show = FALSE), + Description =colDef(show = FALSE), + Type = colDef(name = "Type"), + Level1 =colDef(show = FALSE), + Level2 =colDef(show = FALSE) + ), + searchable = TRUE, + defaultPageSize = 7 +) + +div( + class = "movies", + tbl, + div(id = "modal", class="modal", onclick="hideModal()", + img( + id="modal-image", class="modal-image" + )) +) +``` + +## ๐‰๐”๐‹๐ˆ๐€ + +```{r} +#| echo: false +data_JULIA <- data[data$Level1=="JULIA",] + +tbl <- reactable( + data_JULIA, + defaultColDef = colDef(vAlign = "center", headerClass = "header"), + columns = list( + Id = colDef( + name = "Id", align = "center", minWidth = 70, maxWidth = 90 + ), + Name = colDef( + name = "Graph", cell = JS("renderGraph"), html = TRUE, minWidth = 250 + ), + Image_url = colDef(show = FALSE), + Tutorial_url = colDef(show = FALSE), + Description =colDef(show = FALSE), + Type = colDef(name = "Type"), + Level1 =colDef(show = FALSE), + Level2 =colDef(show = FALSE) + ), + searchable = TRUE, + defaultPageSize = 7 +) + +div( + class = "movies", + tbl, + div(id = "modal", class="modal", onclick="hideModal()", + img( + id="modal-image", class="modal-image" + )) +) +``` + ## ๐‡๐ˆ๐๐‹๐Ž๐“ ### ๅŸบ็ก€ diff --git a/files/gallery_data.csv b/files/gallery_data.csv index f43b2dcac..36bbff45e 100644 --- a/files/gallery_data.csv +++ b/files/gallery_data.csv @@ -785,3 +785,10 @@ 784,Dice Plot with custom theme,https://openbiox.github.io/Bizard/Proportion/DicePlot_files/figure-html/fig-3ThemedDice-1.png,https://openbiox.github.io/Bizard/Proportion/DicePlot.html#fig-3ThemedDice,The package includes theme_dice() for cleaner visualization,Dice Plot,BASICS,Proportion 785,Basic Text Enrichment BarPlot,https://openbiox.github.io/Bizard/Omics/TextEnrichmentBarPlot_files/figure-html/fig1.SimpleRound-1.png,https://openbiox.github.io/Bizard/Omics/TextEnrichmentBarPlot.html#basic-plotting-simplified-version,Basic Enrichment Analysis Barplot,Text Enrichment BarPlot,OMICS,TextEnrichmentBarPlot 786,Advanced Enrichment Analysis Barplot,https://openbiox.github.io/Bizard/Omics/TextEnrichmentBarPlot_files/figure-html/fig2.ComplexRound-1.png,https://openbiox.github.io/Bizard/Omics/TextEnrichmentBarPlot.html#advanced-plotting-detailed-version,Advanced Enrichment Analysis Barplot,Text Enrichment BarPlot,OMICS,TextEnrichmentBarPlot +787,Scatter Plot (Python),https://openbiox.github.io/Bizard/images/Python/ScatterPlot_demo.png,https://openbiox.github.io/Bizard/Python/ScatterPlot.html,Scatter plot showing correlations using matplotlib and seaborn,Scatter Plot,PYTHON,Python +788,Violin Plot (Python),https://openbiox.github.io/Bizard/images/Python/ViolinPlot_demo.png,https://openbiox.github.io/Bizard/Python/ViolinPlot.html,Violin plot combining box plot and kernel density estimation,Violin Plot,PYTHON,Python +789,Heatmap (Python),https://openbiox.github.io/Bizard/images/Python/Heatmap_demo.png,https://openbiox.github.io/Bizard/Python/Heatmap.html,Heatmap for gene expression profiles and correlation matrices,Heatmap,PYTHON,Python +790,Volcano Plot (Python),https://openbiox.github.io/Bizard/images/Python/VolcanoPlot_demo.png,https://openbiox.github.io/Bizard/Python/VolcanoPlot.html,Volcano plot for differential expression analysis,Volcano Plot,PYTHON,Python +791,Scatter Plot (Julia),https://openbiox.github.io/Bizard/images/Julia/ScatterPlot_demo.png,https://openbiox.github.io/Bizard/Julia/ScatterPlot.html,High-performance scatter plot using CairoMakie,Scatter Plot,JULIA,Julia +792,Violin Plot (Julia),https://openbiox.github.io/Bizard/images/Julia/ViolinPlot_demo.png,https://openbiox.github.io/Bizard/Julia/ViolinPlot.html,Violin plot for distribution comparison using CairoMakie,Violin Plot,JULIA,Julia +793,Heatmap (Julia),https://openbiox.github.io/Bizard/images/Julia/Heatmap_demo.png,https://openbiox.github.io/Bizard/Julia/Heatmap.html,Heatmap for matrix visualization using CairoMakie,Heatmap,JULIA,Julia diff --git a/files/gallery_data_zh.csv b/files/gallery_data_zh.csv index 963afe6b2..becfb1198 100644 --- a/files/gallery_data_zh.csv +++ b/files/gallery_data_zh.csv @@ -785,3 +785,10 @@ 784,่‡ชๅฎšไน‰้ชฐๅญๅ›พไธป้ข˜,https://openbiox.github.io/Bizard/zh/Proportion/DicePlot_files/figure-html/fig-3ThemedDice-1.png,https://openbiox.github.io/Bizard/zh/Proportion/DicePlot.html#fig-3ThemedDice,่ฏฅๅŒ…ๅŒ…ๅซ theme_dice() ไปฅๅฎž็Žฐๆ›ดๆธ…ๆ™ฐ็š„ๅฏ่ง†ๅŒ–,้ชฐๅญๅ›พ,BASICS,Proportion 785,ๅŸบ็ก€ๅฏŒ้›†ๅˆ†ๆžๆŸฑ็Šถๅ›พ,https://openbiox.github.io/Bizard/zh/Omics/TextEnrichmentBarPlot_files/figure-html/fig1.SimpleRound-1.png,https://openbiox.github.io/Bizard/zh/Omics/TextEnrichmentBarPlot.html#basic-plotting-simplified-version,ๅŸบ็ก€ๅฏŒ้›†ๅˆ†ๆžๆŸฑ็Šถๅ›พ,ๆ–‡ๅญ—ๅ ๅŠ ็š„ๅฏŒ้›†ๅˆ†ๆžๆŸฑ็Šถๅ›พ,OMICS,TextEnrichmentBarPlot 786,่ฟ›้˜ถๅฏŒ้›†ๅˆ†ๆžๆŸฑ็Šถๅ›พ,https://openbiox.github.io/Bizard/zh/Omics/TextEnrichmentBarPlot_files/figure-html/fig2.ComplexRound-1.png,https://openbiox.github.io/Bizard/zh/Omics/TextEnrichmentBarPlot.html#advanced-plotting-detailed-version,่ฟ›้˜ถๅฏŒ้›†ๅˆ†ๆžๆŸฑ็Šถๅ›พ,ๆ–‡ๅญ—ๅ ๅŠ ็š„ๅฏŒ้›†ๅˆ†ๆžๆŸฑ็Šถๅ›พ,OMICS,TextEnrichmentBarPlot +787,ๆ•ฃ็‚นๅ›พ (Python),https://openbiox.github.io/Bizard/images/Python/ScatterPlot_demo.png,https://openbiox.github.io/Bizard/zh/Python/ScatterPlot.html,ไฝฟ็”จ matplotlib ๅ’Œ seaborn ็ป˜ๅˆถๆ•ฃ็‚นๅ›พๅฑ•็คบๅ˜้‡้—ด็›ธๅ…ณๆ€ง,ๆ•ฃ็‚นๅ›พ,PYTHON,Python +788,ๅฐๆ็ดๅ›พ (Python),https://openbiox.github.io/Bizard/images/Python/ViolinPlot_demo.png,https://openbiox.github.io/Bizard/zh/Python/ViolinPlot.html,ๅฐๆ็ดๅ›พ็ป“ๅˆ็ฎฑ็บฟๅ›พๅ’Œๆ ธๅฏ†ๅบฆไผฐ่ฎกๅฑ•็คบๆ•ฐๆฎๅˆ†ๅธƒ,ๅฐๆ็ดๅ›พ,PYTHON,Python +789,็ƒญๅŠ›ๅ›พ (Python),https://openbiox.github.io/Bizard/images/Python/Heatmap_demo.png,https://openbiox.github.io/Bizard/zh/Python/Heatmap.html,็ƒญๅŠ›ๅ›พ็”จไบŽๅŸบๅ› ่กจ่พพ่ฐฑๅ’Œ็›ธๅ…ณๆ€ง็Ÿฉ้˜ตๅฏ่ง†ๅŒ–,็ƒญๅŠ›ๅ›พ,PYTHON,Python +790,็ซๅฑฑๅ›พ (Python),https://openbiox.github.io/Bizard/images/Python/VolcanoPlot_demo.png,https://openbiox.github.io/Bizard/zh/Python/VolcanoPlot.html,็ซๅฑฑๅ›พ็”จไบŽๅทฎๅผ‚่กจ่พพๅˆ†ๆž็ป“ๆžœๅฏ่ง†ๅŒ–,็ซๅฑฑๅ›พ,PYTHON,Python +791,ๆ•ฃ็‚นๅ›พ (Julia),https://openbiox.github.io/Bizard/images/Julia/ScatterPlot_demo.png,https://openbiox.github.io/Bizard/zh/Julia/ScatterPlot.html,ไฝฟ็”จ CairoMakie ็ป˜ๅˆถ้ซ˜ๆ€ง่ƒฝๆ•ฃ็‚นๅ›พ,ๆ•ฃ็‚นๅ›พ,JULIA,Julia +792,ๅฐๆ็ดๅ›พ (Julia),https://openbiox.github.io/Bizard/images/Julia/ViolinPlot_demo.png,https://openbiox.github.io/Bizard/zh/Julia/ViolinPlot.html,ไฝฟ็”จ CairoMakie ็ป˜ๅˆถๅฐๆ็ดๅ›พๅฑ•็คบๆ•ฐๆฎๅˆ†ๅธƒ,ๅฐๆ็ดๅ›พ,JULIA,Julia +793,็ƒญๅŠ›ๅ›พ (Julia),https://openbiox.github.io/Bizard/images/Julia/Heatmap_demo.png,https://openbiox.github.io/Bizard/zh/Julia/Heatmap.html,ไฝฟ็”จ CairoMakie ็ป˜ๅˆถ็ƒญๅŠ›ๅ›พ่ฟ›่กŒ็Ÿฉ้˜ตๅฏ่ง†ๅŒ–,็ƒญๅŠ›ๅ›พ,JULIA,Julia diff --git a/images/Julia/Heatmap_demo.png b/images/Julia/Heatmap_demo.png index 91b8b47f2..aa02d5c3c 100644 Binary files a/images/Julia/Heatmap_demo.png and b/images/Julia/Heatmap_demo.png differ diff --git a/images/Julia/ScatterPlot_demo.png b/images/Julia/ScatterPlot_demo.png index 91b8b47f2..abfb7e590 100644 Binary files a/images/Julia/ScatterPlot_demo.png and b/images/Julia/ScatterPlot_demo.png differ diff --git a/images/Julia/ViolinPlot_demo.png b/images/Julia/ViolinPlot_demo.png index 91b8b47f2..3461da2d7 100644 Binary files a/images/Julia/ViolinPlot_demo.png and b/images/Julia/ViolinPlot_demo.png differ diff --git a/images/Python/Heatmap_demo.png b/images/Python/Heatmap_demo.png index 91b8b47f2..0e1f9a254 100644 Binary files a/images/Python/Heatmap_demo.png and b/images/Python/Heatmap_demo.png differ diff --git a/images/Python/ScatterPlot_demo.png b/images/Python/ScatterPlot_demo.png index 91b8b47f2..70ea76826 100644 Binary files a/images/Python/ScatterPlot_demo.png and b/images/Python/ScatterPlot_demo.png differ diff --git a/images/Python/ViolinPlot_demo.png b/images/Python/ViolinPlot_demo.png index 91b8b47f2..4df078797 100644 Binary files a/images/Python/ViolinPlot_demo.png and b/images/Python/ViolinPlot_demo.png differ diff --git a/images/Python/VolcanoPlot_demo.png b/images/Python/VolcanoPlot_demo.png index 91b8b47f2..0c2f9de5e 100644 Binary files a/images/Python/VolcanoPlot_demo.png and b/images/Python/VolcanoPlot_demo.png differ diff --git a/skills/Julia/Heatmap_skill.md b/skills/Julia/Heatmap_skill.md index 6c629373c..7d852484c 100644 --- a/skills/Julia/Heatmap_skill.md +++ b/skills/Julia/Heatmap_skill.md @@ -1,4 +1,4 @@ -# Skill: Heatmap (Julia) (Julia) +# Skill: Heatmap (Julia) ## Category Julia @@ -13,6 +13,7 @@ A heatmap visualizes matrix data using color gradients. Julia's `CairoMakie` pro ```julia # Load packages using CairoMakie +using Random # Prepare data Random.seed!(42) @@ -38,8 +39,10 @@ fig ## Key Parameters - `colormap`: Color scheme for the plot (e.g., :viridis, :RdBu) -- `color`: Color of plot elements +- `color`: Color of plot elements (e.g., :steelblue or (:red, 0.5) for alpha) - `colorrange`: Range for color mapping as (min, max) tuple +- `size`: Figure size as (width, height) in pixels +- `alpha`: Transparency via color tuple syntax: color=(:steelblue, 0.7) ## Tips - Save figures with `save("plot.png", fig)` or `save("plot.pdf", fig)` diff --git a/skills/Julia/ScatterPlot_skill.md b/skills/Julia/ScatterPlot_skill.md index cf5c99626..fcfe2a6fc 100644 --- a/skills/Julia/ScatterPlot_skill.md +++ b/skills/Julia/ScatterPlot_skill.md @@ -1,4 +1,4 @@ -# Skill: Scatter Plot (Julia) (Julia) +# Skill: Scatter Plot (Julia) ## Category Julia @@ -15,6 +15,7 @@ A scatter plot displays values for two continuous variables as a collection of p # Load packages using CairoMakie using DataFrames +using Random # Prepare data Random.seed!(42) @@ -45,9 +46,11 @@ fig ## Key Parameters - `colormap`: Color scheme for the plot (e.g., :viridis, :RdBu) - `markersize`: Size of scatter plot markers -- `alpha`: Transparency level (0โ€“1) -- `color`: Color of plot elements +- `color`: Color of plot elements (e.g., :steelblue or (:red, 0.5) for alpha) - `linewidth`: Width of lines in the plot +- `alpha`: Transparency level (0โ€“1) via color tuple (color, alpha) +- `width`: Width of violin or box plot elements +- `size`: Figure size as (width, height) in pixels ## Tips - Save figures with `save("plot.png", fig)` or `save("plot.pdf", fig)` diff --git a/skills/Julia/ViolinPlot_skill.md b/skills/Julia/ViolinPlot_skill.md index d159bce2a..4c3b4fdc3 100644 --- a/skills/Julia/ViolinPlot_skill.md +++ b/skills/Julia/ViolinPlot_skill.md @@ -1,4 +1,4 @@ -# Skill: Violin Plot (Julia) (Julia) +# Skill: Violin Plot (Julia) ## Category Julia @@ -15,6 +15,7 @@ A violin plot combines box plot statistics with kernel density estimation to sho # Load packages using CairoMakie using DataFrames +using Random # Prepare data Random.seed!(42) @@ -39,7 +40,11 @@ fig ## Key Parameters - `markersize`: Size of scatter plot markers -- `color`: Color of plot elements +- `color`: Color of plot elements (e.g., :steelblue or (:red, 0.5) for alpha) +- `side`: Side of violin to draw (:left, :right, or both) +- `width`: Width of violin or box plot elements +- `size`: Figure size as (width, height) in pixels +- `alpha`: Transparency via color tuple syntax: color=(:steelblue, 0.7) ## Tips - Save figures with `save("plot.png", fig)` or `save("plot.pdf", fig)` diff --git a/skills/Python/Heatmap_skill.md b/skills/Python/Heatmap_skill.md index 64240faad..c4957d34d 100644 --- a/skills/Python/Heatmap_skill.md +++ b/skills/Python/Heatmap_skill.md @@ -1,4 +1,4 @@ -# Skill: Heatmap (Python) (Python) +# Skill: Heatmap (Python) ## Category Python diff --git a/skills/Python/ScatterPlot_skill.md b/skills/Python/ScatterPlot_skill.md index d347b6d4e..d7f580635 100644 --- a/skills/Python/ScatterPlot_skill.md +++ b/skills/Python/ScatterPlot_skill.md @@ -1,4 +1,4 @@ -# Skill: Scatter Plot (Python) (Python) +# Skill: Scatter Plot (Python) ## Category Python diff --git a/skills/Python/ViolinPlot_skill.md b/skills/Python/ViolinPlot_skill.md index 4c3c3b531..3228bcaf4 100644 --- a/skills/Python/ViolinPlot_skill.md +++ b/skills/Python/ViolinPlot_skill.md @@ -1,4 +1,4 @@ -# Skill: Violin Plot (Python) (Python) +# Skill: Violin Plot (Python) ## Category Python diff --git a/skills/Python/VolcanoPlot_skill.md b/skills/Python/VolcanoPlot_skill.md index 051570ad2..d5a33b6fc 100644 --- a/skills/Python/VolcanoPlot_skill.md +++ b/skills/Python/VolcanoPlot_skill.md @@ -1,4 +1,4 @@ -# Skill: Volcano Plot (Python) (Python) +# Skill: Volcano Plot (Python) ## Category Python diff --git a/skills/bizard_skills.json b/skills/bizard_skills.json index 864cb041b..a61899908 100644 --- a/skills/bizard_skills.json +++ b/skills/bizard_skills.json @@ -3607,7 +3607,7 @@ ], "use_when": "A heatmap visualizes matrix data using color gradients. Julia's `CairoMakie` provides high-performance heatmap rendering suitable for large gene expression matrices and multi-omics data. The Makie ecosystem supports annotations, clustering, and complex layouts for publication-quality figures.", "tutorial_url": "https://openbiox.github.io/Bizard/Julia/Heatmap.html", - "skill": "# Skill: Heatmap (Julia) (Julia)\n\n## Category\nJulia\n\n## When to Use\nA heatmap visualizes matrix data using color gradients. Julia's `CairoMakie` provides high-performance heatmap rendering suitable for large gene expression matrices and multi-omics data. The Makie ecosystem supports annotations, clustering, and complex layouts for publication-quality figures.\n\n## Required Julia Packages\n- CairoMakie\n\n## Minimal Reproducible Code\n```julia\n# Load packages\nusing CairoMakie\n\n# Prepare data\nRandom.seed!(42)\nn_genes = 20\nn_samples = 10\nexpr_matrix = randn(n_genes, n_samples)\nexpr_matrix[1:8, 1:5] .+= 2.5\nexpr_matrix[9:15, 6:10] .+= 2.0\ngene_names = [\"Gene_$i\" for i in 1:n_genes]\nsample_names = [\"S$i\" for i in 1:n_samples]\n\n# Create visualization\nfig = Figure(size=(700, 600))\nax = Axis(fig[1,1], xlabel=\"Samples\", ylabel=\"Genes\",\n title=\"Gene Expression Heatmap\",\n xticks=(1:n_samples, sample_names),\n yticks=(1:n_genes, gene_names))\nhm = heatmap!(ax, 1:n_samples, 1:n_genes, expr_matrix',\n colormap=:RdBu, colorrange=(-3, 3))\nColorbar(fig[1,2], hm, label=\"Expression (z-score)\")\nfig\n```\n\n## Key Parameters\n- `colormap`: Color scheme for the plot (e.g., :viridis, :RdBu)\n- `color`: Color of plot elements\n- `colorrange`: Range for color mapping as (min, max) tuple\n\n## Tips\n- Save figures with `save(\"plot.png\", fig)` or `save(\"plot.pdf\", fig)`\n- Adjust figure resolution with `Figure(size=(800, 600), figure_padding=20)`\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Julia/Heatmap.html\n", + "skill": "# Skill: Heatmap (Julia)\n\n## Category\nJulia\n\n## When to Use\nA heatmap visualizes matrix data using color gradients. Julia's `CairoMakie` provides high-performance heatmap rendering suitable for large gene expression matrices and multi-omics data. The Makie ecosystem supports annotations, clustering, and complex layouts for publication-quality figures.\n\n## Required Julia Packages\n- CairoMakie\n\n## Minimal Reproducible Code\n```julia\n# Load packages\nusing CairoMakie\nusing Random\n\n# Prepare data\nRandom.seed!(42)\nn_genes = 20\nn_samples = 10\nexpr_matrix = randn(n_genes, n_samples)\nexpr_matrix[1:8, 1:5] .+= 2.5\nexpr_matrix[9:15, 6:10] .+= 2.0\ngene_names = [\"Gene_$i\" for i in 1:n_genes]\nsample_names = [\"S$i\" for i in 1:n_samples]\n\n# Create visualization\nfig = Figure(size=(700, 600))\nax = Axis(fig[1,1], xlabel=\"Samples\", ylabel=\"Genes\",\n title=\"Gene Expression Heatmap\",\n xticks=(1:n_samples, sample_names),\n yticks=(1:n_genes, gene_names))\nhm = heatmap!(ax, 1:n_samples, 1:n_genes, expr_matrix',\n colormap=:RdBu, colorrange=(-3, 3))\nColorbar(fig[1,2], hm, label=\"Expression (z-score)\")\nfig\n```\n\n## Key Parameters\n- `colormap`: Color scheme for the plot (e.g., :viridis, :RdBu)\n- `color`: Color of plot elements (e.g., :steelblue or (:red, 0.5) for alpha)\n- `colorrange`: Range for color mapping as (min, max) tuple\n- `size`: Figure size as (width, height) in pixels\n- `alpha`: Transparency via color tuple syntax: color=(:steelblue, 0.7)\n\n## Tips\n- Save figures with `save(\"plot.png\", fig)` or `save(\"plot.pdf\", fig)`\n- Adjust figure resolution with `Figure(size=(800, 600), figure_padding=20)`\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Julia/Heatmap.html\n", "source_file": "Julia/Heatmap.qmd", "skill_file": "skills/Julia/Heatmap_skill.md" }, @@ -3621,7 +3621,7 @@ ], "use_when": "A scatter plot displays values for two continuous variables as a collection of points. Julia's `CairoMakie` package (part of the Makie.jl ecosystem) provides high-performance, GPU-accelerated plotting capabilities ideal for large biomedical datasets. Makie offers publication-quality rendering with a composable, declarative API.", "tutorial_url": "https://openbiox.github.io/Bizard/Julia/ScatterPlot.html", - "skill": "# Skill: Scatter Plot (Julia) (Julia)\n\n## Category\nJulia\n\n## When to Use\nA scatter plot displays values for two continuous variables as a collection of points. Julia's `CairoMakie` package (part of the Makie.jl ecosystem) provides high-performance, GPU-accelerated plotting capabilities ideal for large biomedical datasets. Makie offers publication-quality rendering with a composable, declarative API.\n\n## Required Julia Packages\n- CairoMakie\n- DataFrames\n\n## Minimal Reproducible Code\n```julia\n# Load packages\nusing CairoMakie\nusing DataFrames\n\n# Prepare data\nRandom.seed!(42)\nn = 150\nspecies = repeat([\"setosa\", \"versicolor\", \"virginica\"], inner=50)\nsepal_length = [randn(50) .* 0.35 .+ 5.0;\n randn(50) .* 0.52 .+ 5.9;\n randn(50) .* 0.64 .+ 6.6]\nsepal_width = [randn(50) .* 0.38 .+ 3.4;\n randn(50) .* 0.31 .+ 2.8;\n randn(50) .* 0.32 .+ 3.0]\niris_df = DataFrame(species=species, sepal_length=sepal_length, sepal_width=sepal_width)\n\n# Create visualization\nfig = Figure(size=(700, 500))\nax = Axis(fig[1,1], xlabel=\"Sepal Length (cm)\", ylabel=\"Sepal Width (cm)\",\n title=\"Iris Scatter Plot\")\ncolors_map = Dict(\"setosa\" => :steelblue, \"versicolor\" => :coral, \"virginica\" => :green)\nfor sp in unique(iris_df.species)\n mask = iris_df.species .== sp\n scatter!(ax, iris_df.sepal_length[mask], iris_df.sepal_width[mask],\n color=colors_map[sp], markersize=10, alpha=0.7, label=sp)\nend\naxislegend(ax, position=:rt)\nfig\n```\n\n## Key Parameters\n- `colormap`: Color scheme for the plot (e.g., :viridis, :RdBu)\n- `markersize`: Size of scatter plot markers\n- `alpha`: Transparency level (0โ€“1)\n- `color`: Color of plot elements\n- `linewidth`: Width of lines in the plot\n\n## Tips\n- Save figures with `save(\"plot.png\", fig)` or `save(\"plot.pdf\", fig)`\n- Adjust figure resolution with `Figure(size=(800, 600), figure_padding=20)`\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Julia/ScatterPlot.html\n", + "skill": "# Skill: Scatter Plot (Julia)\n\n## Category\nJulia\n\n## When to Use\nA scatter plot displays values for two continuous variables as a collection of points. Julia's `CairoMakie` package (part of the Makie.jl ecosystem) provides high-performance, GPU-accelerated plotting capabilities ideal for large biomedical datasets. Makie offers publication-quality rendering with a composable, declarative API.\n\n## Required Julia Packages\n- CairoMakie\n- DataFrames\n\n## Minimal Reproducible Code\n```julia\n# Load packages\nusing CairoMakie\nusing DataFrames\nusing Random\n\n# Prepare data\nRandom.seed!(42)\nn = 150\nspecies = repeat([\"setosa\", \"versicolor\", \"virginica\"], inner=50)\nsepal_length = [randn(50) .* 0.35 .+ 5.0;\n randn(50) .* 0.52 .+ 5.9;\n randn(50) .* 0.64 .+ 6.6]\nsepal_width = [randn(50) .* 0.38 .+ 3.4;\n randn(50) .* 0.31 .+ 2.8;\n randn(50) .* 0.32 .+ 3.0]\niris_df = DataFrame(species=species, sepal_length=sepal_length, sepal_width=sepal_width)\n\n# Create visualization\nfig = Figure(size=(700, 500))\nax = Axis(fig[1,1], xlabel=\"Sepal Length (cm)\", ylabel=\"Sepal Width (cm)\",\n title=\"Iris Scatter Plot\")\ncolors_map = Dict(\"setosa\" => :steelblue, \"versicolor\" => :coral, \"virginica\" => :green)\nfor sp in unique(iris_df.species)\n mask = iris_df.species .== sp\n scatter!(ax, iris_df.sepal_length[mask], iris_df.sepal_width[mask],\n color=colors_map[sp], markersize=10, alpha=0.7, label=sp)\nend\naxislegend(ax, position=:rt)\nfig\n```\n\n## Key Parameters\n- `colormap`: Color scheme for the plot (e.g., :viridis, :RdBu)\n- `markersize`: Size of scatter plot markers\n- `color`: Color of plot elements (e.g., :steelblue or (:red, 0.5) for alpha)\n- `linewidth`: Width of lines in the plot\n- `alpha`: Transparency level (0โ€“1) via color tuple (color, alpha)\n- `width`: Width of violin or box plot elements\n- `size`: Figure size as (width, height) in pixels\n\n## Tips\n- Save figures with `save(\"plot.png\", fig)` or `save(\"plot.pdf\", fig)`\n- Adjust figure resolution with `Figure(size=(800, 600), figure_padding=20)`\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Julia/ScatterPlot.html\n", "source_file": "Julia/ScatterPlot.qmd", "skill_file": "skills/Julia/ScatterPlot_skill.md" }, @@ -3635,7 +3635,7 @@ ], "use_when": "A violin plot combines box plot statistics with kernel density estimation to show data distributions. Julia's `CairoMakie` makes it straightforward to create violin plots for comparing gene expression, biomarker levels, or clinical measurements across groups.", "tutorial_url": "https://openbiox.github.io/Bizard/Julia/ViolinPlot.html", - "skill": "# Skill: Violin Plot (Julia) (Julia)\n\n## Category\nJulia\n\n## When to Use\nA violin plot combines box plot statistics with kernel density estimation to show data distributions. Julia's `CairoMakie` makes it straightforward to create violin plots for comparing gene expression, biomarker levels, or clinical measurements across groups.\n\n## Required Julia Packages\n- CairoMakie\n- DataFrames\n\n## Minimal Reproducible Code\n```julia\n# Load packages\nusing CairoMakie\nusing DataFrames\n\n# Prepare data\nRandom.seed!(42)\nn_per = 80\ngroups = vcat(fill(\"Tumor\", n_per), fill(\"Normal\", n_per), fill(\"Adjacent\", n_per))\nexpression = vcat(\n randn(n_per) .* 1.5 .+ 8,\n randn(n_per) .* 1.2 .+ 5,\n randn(n_per) .* 1.8 .+ 6.5\n)\ngroup_idx = vcat(fill(1, n_per), fill(2, n_per), fill(3, n_per))\ndf = DataFrame(Group=groups, Expression=expression, GroupIdx=group_idx)\n\n# Create visualization\nfig = Figure(size=(700, 500))\nax = Axis(fig[1,1], xlabel=\"Group\", ylabel=\"Expression Level\",\n title=\"Gene Expression Distribution\",\n xticks=(1:3, [\"Tumor\", \"Normal\", \"Adjacent\"]))\nviolin!(ax, df.GroupIdx, df.Expression, color=(:steelblue, 0.7))\nfig\n```\n\n## Key Parameters\n- `markersize`: Size of scatter plot markers\n- `color`: Color of plot elements\n\n## Tips\n- Save figures with `save(\"plot.png\", fig)` or `save(\"plot.pdf\", fig)`\n- Adjust figure resolution with `Figure(size=(800, 600), figure_padding=20)`\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Julia/ViolinPlot.html\n", + "skill": "# Skill: Violin Plot (Julia)\n\n## Category\nJulia\n\n## When to Use\nA violin plot combines box plot statistics with kernel density estimation to show data distributions. Julia's `CairoMakie` makes it straightforward to create violin plots for comparing gene expression, biomarker levels, or clinical measurements across groups.\n\n## Required Julia Packages\n- CairoMakie\n- DataFrames\n\n## Minimal Reproducible Code\n```julia\n# Load packages\nusing CairoMakie\nusing DataFrames\nusing Random\n\n# Prepare data\nRandom.seed!(42)\nn_per = 80\ngroups = vcat(fill(\"Tumor\", n_per), fill(\"Normal\", n_per), fill(\"Adjacent\", n_per))\nexpression = vcat(\n randn(n_per) .* 1.5 .+ 8,\n randn(n_per) .* 1.2 .+ 5,\n randn(n_per) .* 1.8 .+ 6.5\n)\ngroup_idx = vcat(fill(1, n_per), fill(2, n_per), fill(3, n_per))\ndf = DataFrame(Group=groups, Expression=expression, GroupIdx=group_idx)\n\n# Create visualization\nfig = Figure(size=(700, 500))\nax = Axis(fig[1,1], xlabel=\"Group\", ylabel=\"Expression Level\",\n title=\"Gene Expression Distribution\",\n xticks=(1:3, [\"Tumor\", \"Normal\", \"Adjacent\"]))\nviolin!(ax, df.GroupIdx, df.Expression, color=(:steelblue, 0.7))\nfig\n```\n\n## Key Parameters\n- `markersize`: Size of scatter plot markers\n- `color`: Color of plot elements (e.g., :steelblue or (:red, 0.5) for alpha)\n- `side`: Side of violin to draw (:left, :right, or both)\n- `width`: Width of violin or box plot elements\n- `size`: Figure size as (width, height) in pixels\n- `alpha`: Transparency via color tuple syntax: color=(:steelblue, 0.7)\n\n## Tips\n- Save figures with `save(\"plot.png\", fig)` or `save(\"plot.pdf\", fig)`\n- Adjust figure resolution with `Figure(size=(800, 600), figure_padding=20)`\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Julia/ViolinPlot.html\n", "source_file": "Julia/ViolinPlot.qmd", "skill_file": "skills/Julia/ViolinPlot_skill.md" }, @@ -4001,7 +4001,7 @@ ], "use_when": "A heatmap is a data visualization technique that uses color to represent values in a matrix. In biomedical research, heatmaps are essential for visualizing gene expression profiles, correlation matrices, methylation data, and drug response panels. Python's `seaborn` and `matplotlib` libraries offer powerful heatmap capabilities with built-in clustering support.", "tutorial_url": "https://openbiox.github.io/Bizard/Python/Heatmap.html", - "skill": "# Skill: Heatmap (Python) (Python)\n\n## Category\nPython\n\n## When to Use\nA heatmap is a data visualization technique that uses color to represent values in a matrix. In biomedical research, heatmaps are essential for visualizing gene expression profiles, correlation matrices, methylation data, and drug response panels. Python's `seaborn` and `matplotlib` libraries offer powerful heatmap capabilities with built-in clustering support.\n\n## Required Python Packages\n- matplotlib\n- numpy\n- pandas\n- scipy\n- seaborn\n\n## Minimal Reproducible Code\n```python\n# Load packages\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nimport numpy as np\nfrom scipy.cluster.hierarchy import linkage\n\n# Prepare data\nnp.random.seed(42)\nn_genes = 30\nn_samples = 12\ngene_names = [f'Gene_{i+1}' for i in range(n_genes)]\nsample_names = [f'Sample_{i+1}' for i in range(n_samples)]\ngroups = ['Tumor'] * 6 + ['Normal'] * 6\n\nexpr_matrix = np.random.randn(n_genes, n_samples)\nexpr_matrix[:10, :6] += 2.5\nexpr_matrix[10:20, 6:] += 2.0\n\nexpr_df = pd.DataFrame(expr_matrix, index=gene_names, columns=sample_names)\n\n# Create visualization\nfig, ax = plt.subplots(figsize=(10, 8))\nsns.heatmap(expr_df, cmap='RdBu_r', center=0, xticklabels=True,\n yticklabels=True, linewidths=0.5, ax=ax)\nax.set_title('Gene Expression Heatmap')\nax.set_xlabel('Samples')\nax.set_ylabel('Genes')\nplt.tight_layout()\nplt.show()\n```\n\n## Key Parameters\n- `figsize`: Figure dimensions as (width, height) in inches\n- `cmap`: Colormap for continuous color mapping\n- `annot`: Whether to annotate cells with values (True/False)\n\n## Tips\n- Call `plt.tight_layout()` to prevent label overlap\n- Seaborn integrates with pandas DataFrames for convenient column-based plotting\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Python/Heatmap.html\n", + "skill": "# Skill: Heatmap (Python)\n\n## Category\nPython\n\n## When to Use\nA heatmap is a data visualization technique that uses color to represent values in a matrix. In biomedical research, heatmaps are essential for visualizing gene expression profiles, correlation matrices, methylation data, and drug response panels. Python's `seaborn` and `matplotlib` libraries offer powerful heatmap capabilities with built-in clustering support.\n\n## Required Python Packages\n- matplotlib\n- numpy\n- pandas\n- scipy\n- seaborn\n\n## Minimal Reproducible Code\n```python\n# Load packages\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nimport numpy as np\nfrom scipy.cluster.hierarchy import linkage\n\n# Prepare data\nnp.random.seed(42)\nn_genes = 30\nn_samples = 12\ngene_names = [f'Gene_{i+1}' for i in range(n_genes)]\nsample_names = [f'Sample_{i+1}' for i in range(n_samples)]\ngroups = ['Tumor'] * 6 + ['Normal'] * 6\n\nexpr_matrix = np.random.randn(n_genes, n_samples)\nexpr_matrix[:10, :6] += 2.5\nexpr_matrix[10:20, 6:] += 2.0\n\nexpr_df = pd.DataFrame(expr_matrix, index=gene_names, columns=sample_names)\n\n# Create visualization\nfig, ax = plt.subplots(figsize=(10, 8))\nsns.heatmap(expr_df, cmap='RdBu_r', center=0, xticklabels=True,\n yticklabels=True, linewidths=0.5, ax=ax)\nax.set_title('Gene Expression Heatmap')\nax.set_xlabel('Samples')\nax.set_ylabel('Genes')\nplt.tight_layout()\nplt.show()\n```\n\n## Key Parameters\n- `figsize`: Figure dimensions as (width, height) in inches\n- `cmap`: Colormap for continuous color mapping\n- `annot`: Whether to annotate cells with values (True/False)\n\n## Tips\n- Call `plt.tight_layout()` to prevent label overlap\n- Seaborn integrates with pandas DataFrames for convenient column-based plotting\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Python/Heatmap.html\n", "source_file": "Python/Heatmap.qmd", "skill_file": "skills/Python/Heatmap_skill.md" }, @@ -4018,7 +4018,7 @@ ], "use_when": "A scatter plot displays values for two continuous variables as a collection of points. In biomedical research, scatter plots are widely used for visualizing correlations between gene expression levels, comparing biomarkers, and exploring relationships in multi-omics datasets. Python's `matplotlib` and `seaborn` libraries provide flexible and publication-quality scatter plot capabilities.", "tutorial_url": "https://openbiox.github.io/Bizard/Python/ScatterPlot.html", - "skill": "# Skill: Scatter Plot (Python) (Python)\n\n## Category\nPython\n\n## When to Use\nA scatter plot displays values for two continuous variables as a collection of points. In biomedical research, scatter plots are widely used for visualizing correlations between gene expression levels, comparing biomarkers, and exploring relationships in multi-omics datasets. Python's `matplotlib` and `seaborn` libraries provide flexible and publication-quality scatter plot capabilities.\n\n## Required Python Packages\n- matplotlib\n- numpy\n- pandas\n- scipy\n- seaborn\n\n## Minimal Reproducible Code\n```python\n# Load packages\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nimport numpy as np\nfrom scipy import stats\n\n# Prepare data\niris = sns.load_dataset(\"iris\")\n\nnp.random.seed(42)\nn = 200\ngene_data = pd.DataFrame({\n 'GeneA': np.random.normal(5, 2, n),\n 'GeneB': np.random.normal(5, 2, n),\n 'Group': np.random.choice(['Tumor', 'Normal'], n)\n})\ngene_data.loc[gene_data['Group'] == 'Tumor', 'GeneA'] += 2\ngene_data.loc[gene_data['Group'] == 'Tumor', 'GeneB'] += 1.5\n\n# Create visualization\nfig, ax = plt.subplots(figsize=(8, 6))\nfor species in iris['species'].unique():\n subset = iris[iris['species'] == species]\n ax.scatter(subset['sepal_length'], subset['sepal_width'],\n label=species, alpha=0.7, edgecolors='white', linewidth=0.5)\nax.set_xlabel('Sepal Length (cm)')\nax.set_ylabel('Sepal Width (cm)')\nax.set_title('Iris Scatter Plot')\nax.legend(title='Species')\nax.spines[['top', 'right']].set_visible(False)\nplt.tight_layout()\nplt.show()\n```\n\n## Key Parameters\n- `palette`: Color palette for the plot (e.g., Set2, viridis, coolwarm)\n- `figsize`: Figure dimensions as (width, height) in inches\n- `alpha`: Transparency level (0โ€“1)\n- `hue`: Variable for color grouping\n\n## Tips\n- Call `plt.tight_layout()` to prevent label overlap\n- Seaborn integrates with pandas DataFrames for convenient column-based plotting\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Python/ScatterPlot.html\n", + "skill": "# Skill: Scatter Plot (Python)\n\n## Category\nPython\n\n## When to Use\nA scatter plot displays values for two continuous variables as a collection of points. In biomedical research, scatter plots are widely used for visualizing correlations between gene expression levels, comparing biomarkers, and exploring relationships in multi-omics datasets. Python's `matplotlib` and `seaborn` libraries provide flexible and publication-quality scatter plot capabilities.\n\n## Required Python Packages\n- matplotlib\n- numpy\n- pandas\n- scipy\n- seaborn\n\n## Minimal Reproducible Code\n```python\n# Load packages\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nimport numpy as np\nfrom scipy import stats\n\n# Prepare data\niris = sns.load_dataset(\"iris\")\n\nnp.random.seed(42)\nn = 200\ngene_data = pd.DataFrame({\n 'GeneA': np.random.normal(5, 2, n),\n 'GeneB': np.random.normal(5, 2, n),\n 'Group': np.random.choice(['Tumor', 'Normal'], n)\n})\ngene_data.loc[gene_data['Group'] == 'Tumor', 'GeneA'] += 2\ngene_data.loc[gene_data['Group'] == 'Tumor', 'GeneB'] += 1.5\n\n# Create visualization\nfig, ax = plt.subplots(figsize=(8, 6))\nfor species in iris['species'].unique():\n subset = iris[iris['species'] == species]\n ax.scatter(subset['sepal_length'], subset['sepal_width'],\n label=species, alpha=0.7, edgecolors='white', linewidth=0.5)\nax.set_xlabel('Sepal Length (cm)')\nax.set_ylabel('Sepal Width (cm)')\nax.set_title('Iris Scatter Plot')\nax.legend(title='Species')\nax.spines[['top', 'right']].set_visible(False)\nplt.tight_layout()\nplt.show()\n```\n\n## Key Parameters\n- `palette`: Color palette for the plot (e.g., Set2, viridis, coolwarm)\n- `figsize`: Figure dimensions as (width, height) in inches\n- `alpha`: Transparency level (0โ€“1)\n- `hue`: Variable for color grouping\n\n## Tips\n- Call `plt.tight_layout()` to prevent label overlap\n- Seaborn integrates with pandas DataFrames for convenient column-based plotting\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Python/ScatterPlot.html\n", "source_file": "Python/ScatterPlot.qmd", "skill_file": "skills/Python/ScatterPlot_skill.md" }, @@ -4034,7 +4034,7 @@ ], "use_when": "A violin plot combines a box plot and a kernel density estimation to show the distribution of continuous data across categories. In biomedical research, violin plots are ideal for comparing gene expression distributions, drug response measurements, or clinical biomarker levels across patient groups. Python's `seaborn` library makes it simple to create beautiful violin plots.", "tutorial_url": "https://openbiox.github.io/Bizard/Python/ViolinPlot.html", - "skill": "# Skill: Violin Plot (Python) (Python)\n\n## Category\nPython\n\n## When to Use\nA violin plot combines a box plot and a kernel density estimation to show the distribution of continuous data across categories. In biomedical research, violin plots are ideal for comparing gene expression distributions, drug response measurements, or clinical biomarker levels across patient groups. Python's `seaborn` library makes it simple to create beautiful violin plots.\n\n## Required Python Packages\n- matplotlib\n- numpy\n- pandas\n- seaborn\n\n## Minimal Reproducible Code\n```python\n# Load packages\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nimport numpy as np\n\n# Prepare data\niris = sns.load_dataset(\"iris\")\n\nnp.random.seed(42)\nn_per_group = 80\ngroups = ['Tumor', 'Normal', 'Adjacent']\ngene_expr = pd.DataFrame({\n 'Expression': np.concatenate([\n np.random.normal(8, 1.5, n_per_group),\n np.random.normal(5, 1.2, n_per_group),\n np.random.normal(6.5, 1.8, n_per_group)\n ]),\n 'Group': np.repeat(groups, n_per_group),\n 'Gene': np.tile(np.repeat(['TP53', 'BRCA1'], n_per_group // 2), 3)\n})\n\n# Create visualization\nfig, ax = plt.subplots(figsize=(8, 6))\nsns.violinplot(data=iris, x='species', y='sepal_length', palette='Set2',\n inner='box', ax=ax)\nax.set_xlabel('Species')\nax.set_ylabel('Sepal Length (cm)')\nax.set_title('Distribution of Sepal Length by Species')\nax.spines[['top', 'right']].set_visible(False)\nplt.tight_layout()\nplt.show()\n```\n\n## Key Parameters\n- `palette`: Color palette for the plot (e.g., Set2, viridis, coolwarm)\n- `figsize`: Figure dimensions as (width, height) in inches\n- `alpha`: Transparency level (0โ€“1)\n- `inner`: Representation inside violin (box, quartile, point, stick, None)\n- `hue`: Variable for color grouping\n\n## Tips\n- Call `plt.tight_layout()` to prevent label overlap\n- Seaborn integrates with pandas DataFrames for convenient column-based plotting\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Python/ViolinPlot.html\n", + "skill": "# Skill: Violin Plot (Python)\n\n## Category\nPython\n\n## When to Use\nA violin plot combines a box plot and a kernel density estimation to show the distribution of continuous data across categories. In biomedical research, violin plots are ideal for comparing gene expression distributions, drug response measurements, or clinical biomarker levels across patient groups. Python's `seaborn` library makes it simple to create beautiful violin plots.\n\n## Required Python Packages\n- matplotlib\n- numpy\n- pandas\n- seaborn\n\n## Minimal Reproducible Code\n```python\n# Load packages\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nimport numpy as np\n\n# Prepare data\niris = sns.load_dataset(\"iris\")\n\nnp.random.seed(42)\nn_per_group = 80\ngroups = ['Tumor', 'Normal', 'Adjacent']\ngene_expr = pd.DataFrame({\n 'Expression': np.concatenate([\n np.random.normal(8, 1.5, n_per_group),\n np.random.normal(5, 1.2, n_per_group),\n np.random.normal(6.5, 1.8, n_per_group)\n ]),\n 'Group': np.repeat(groups, n_per_group),\n 'Gene': np.tile(np.repeat(['TP53', 'BRCA1'], n_per_group // 2), 3)\n})\n\n# Create visualization\nfig, ax = plt.subplots(figsize=(8, 6))\nsns.violinplot(data=iris, x='species', y='sepal_length', palette='Set2',\n inner='box', ax=ax)\nax.set_xlabel('Species')\nax.set_ylabel('Sepal Length (cm)')\nax.set_title('Distribution of Sepal Length by Species')\nax.spines[['top', 'right']].set_visible(False)\nplt.tight_layout()\nplt.show()\n```\n\n## Key Parameters\n- `palette`: Color palette for the plot (e.g., Set2, viridis, coolwarm)\n- `figsize`: Figure dimensions as (width, height) in inches\n- `alpha`: Transparency level (0โ€“1)\n- `inner`: Representation inside violin (box, quartile, point, stick, None)\n- `hue`: Variable for color grouping\n\n## Tips\n- Call `plt.tight_layout()` to prevent label overlap\n- Seaborn integrates with pandas DataFrames for convenient column-based plotting\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Python/ViolinPlot.html\n", "source_file": "Python/ViolinPlot.qmd", "skill_file": "skills/Python/ViolinPlot_skill.md" }, @@ -4049,7 +4049,7 @@ ], "use_when": "A volcano plot displays statistical significance (-log10 p-value) versus fold-change (log2 FC) for thousands of features simultaneously. In biomedical research, volcano plots are the standard visualization for differential gene expression results from RNA-seq, proteomics, and metabolomics. Python's `matplotlib` provides full control over customizing these publication-ready plots.", "tutorial_url": "https://openbiox.github.io/Bizard/Python/VolcanoPlot.html", - "skill": "# Skill: Volcano Plot (Python) (Python)\n\n## Category\nPython\n\n## When to Use\nA volcano plot displays statistical significance (-log10 p-value) versus fold-change (log2 FC) for thousands of features simultaneously. In biomedical research, volcano plots are the standard visualization for differential gene expression results from RNA-seq, proteomics, and metabolomics. Python's `matplotlib` provides full control over customizing these publication-ready plots.\n\n## Required Python Packages\n- matplotlib\n- numpy\n- pandas\n\n## Minimal Reproducible Code\n```python\n# Load packages\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\n\n# Prepare data\nnp.random.seed(42)\nn_genes = 5000\ndf = pd.DataFrame({\n 'gene': [f'Gene{i+1}' for i in range(n_genes)],\n 'log2FC': np.random.normal(0, 1.5, n_genes),\n 'pvalue': np.random.uniform(1e-10, 1, n_genes)\n})\ndf['neg_log10p'] = -np.log10(df['pvalue'])\n\nfc_thresh = 1.0\np_thresh = 0.05\n\nconditions = [\n (df['log2FC'] > fc_thresh) & (df['pvalue'] < p_thresh),\n (df['log2FC'] < -fc_thresh) & (df['pvalue'] < p_thresh),\n]\nchoices = ['Up', 'Down']\ndf['regulation'] = np.select(conditions, choices, default='NS')\n\n# Create visualization\ncolors = {'Up': '#e63946', 'Down': '#457b9d', 'NS': '#cccccc'}\nfig, ax = plt.subplots(figsize=(8, 6))\nfor reg, color in colors.items():\n subset = df[df['regulation'] == reg]\n ax.scatter(subset['log2FC'], subset['neg_log10p'],\n c=color, s=8, alpha=0.6, label=f'{reg} ({len(subset)})')\nax.axhline(-np.log10(p_thresh), color='grey', linestyle='--', linewidth=0.8)\nax.axvline(fc_thresh, color='grey', linestyle='--', linewidth=0.8)\nax.axvline(-fc_thresh, color='grey', linestyle='--', linewidth=0.8)\nax.set_xlabel('logโ‚‚(Fold Change)')\nax.set_ylabel('-logโ‚โ‚€(P-value)')\nax.set_title('Volcano Plot')\nax.legend(frameon=False)\nax.spines[['top', 'right']].set_visible(False)\nplt.tight_layout()\nplt.show()\n```\n\n## Key Parameters\n- `figsize`: Figure dimensions as (width, height) in inches\n- `alpha`: Transparency level (0โ€“1)\n- `annot`: Whether to annotate cells with values (True/False)\n\n## Tips\n- The tutorial includes a 'Enhanced Volcano with Significance Regions' section with advanced styling options\n- Call `plt.tight_layout()` to prevent label overlap\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Python/VolcanoPlot.html\n", + "skill": "# Skill: Volcano Plot (Python)\n\n## Category\nPython\n\n## When to Use\nA volcano plot displays statistical significance (-log10 p-value) versus fold-change (log2 FC) for thousands of features simultaneously. In biomedical research, volcano plots are the standard visualization for differential gene expression results from RNA-seq, proteomics, and metabolomics. Python's `matplotlib` provides full control over customizing these publication-ready plots.\n\n## Required Python Packages\n- matplotlib\n- numpy\n- pandas\n\n## Minimal Reproducible Code\n```python\n# Load packages\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\n\n# Prepare data\nnp.random.seed(42)\nn_genes = 5000\ndf = pd.DataFrame({\n 'gene': [f'Gene{i+1}' for i in range(n_genes)],\n 'log2FC': np.random.normal(0, 1.5, n_genes),\n 'pvalue': np.random.uniform(1e-10, 1, n_genes)\n})\ndf['neg_log10p'] = -np.log10(df['pvalue'])\n\nfc_thresh = 1.0\np_thresh = 0.05\n\nconditions = [\n (df['log2FC'] > fc_thresh) & (df['pvalue'] < p_thresh),\n (df['log2FC'] < -fc_thresh) & (df['pvalue'] < p_thresh),\n]\nchoices = ['Up', 'Down']\ndf['regulation'] = np.select(conditions, choices, default='NS')\n\n# Create visualization\ncolors = {'Up': '#e63946', 'Down': '#457b9d', 'NS': '#cccccc'}\nfig, ax = plt.subplots(figsize=(8, 6))\nfor reg, color in colors.items():\n subset = df[df['regulation'] == reg]\n ax.scatter(subset['log2FC'], subset['neg_log10p'],\n c=color, s=8, alpha=0.6, label=f'{reg} ({len(subset)})')\nax.axhline(-np.log10(p_thresh), color='grey', linestyle='--', linewidth=0.8)\nax.axvline(fc_thresh, color='grey', linestyle='--', linewidth=0.8)\nax.axvline(-fc_thresh, color='grey', linestyle='--', linewidth=0.8)\nax.set_xlabel('logโ‚‚(Fold Change)')\nax.set_ylabel('-logโ‚โ‚€(P-value)')\nax.set_title('Volcano Plot')\nax.legend(frameon=False)\nax.spines[['top', 'right']].set_visible(False)\nplt.tight_layout()\nplt.show()\n```\n\n## Key Parameters\n- `figsize`: Figure dimensions as (width, height) in inches\n- `alpha`: Transparency level (0โ€“1)\n- `annot`: Whether to annotate cells with values (True/False)\n\n## Tips\n- The tutorial includes a 'Enhanced Volcano with Significance Regions' section with advanced styling options\n- Call `plt.tight_layout()` to prevent label overlap\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Python/VolcanoPlot.html\n", "source_file": "Python/VolcanoPlot.qmd", "skill_file": "skills/Python/VolcanoPlot_skill.md" }, @@ -4207,27 +4207,5 @@ "skill": "# Skill: Wordcloud (R)\n\n## Category\nRanking\n\n## When to Use\nA word cloud is a visual representation of text words, which allows you to clearly see the keywords (high-frequency words) in a large amount of text data.\n\n## Required R Packages\n- dplyr\n- htmlwidgets\n- jiebaR\n- jiebaRD\n- tidyverse\n- webshot2\n- wordcloud2\n\n## Minimal Reproducible Code\n```r\n# Load packages\nlibrary(dplyr)\nlibrary(htmlwidgets)\nlibrary(jiebaR)\nlibrary(jiebaRD)\nlibrary(tidyverse)\nlibrary(webshot2)\n\n# Prepare data\n# 1.Chinese abstract text\nwords <- read.csv(\"https://bizard-1301043367.cos.ap-guangzhou.myqcloud.com/words.txt\",header = FALSE,sep=\"\\n\")\nwords <- as.character(words)\n\nhead_words <- substr(words, start = 1, stop = 20)\n\nhead_words\n\n# 2.demoFreq dataset\ndata <- demoFreq\n\nhead(data)\n\n# 3.English abstract text\nwords_english <- read.csv(\"https://bizard-1301043367.cos.ap-guangzhou.myqcloud.com/words_english.txt\",header = FALSE,sep=\"\\n\")\n\nwords_english <- as.character(words_english)\n\nhead_words_english <- substr(words_english, start = 1, stop = 20)\n\nhead_words_english\n\n# Create visualization\n# Basic Plotting\nBasicPlot <- wordcloud2(data = words_seg, size = 1)\nBasicPlot\n```\n\n## Key Parameters\n- `fill`: Maps a variable to fill color for group comparison\n- `color`: Maps a variable to outline/point color\n\n## Tips\n- Adjust text size with `theme(text = element_text(size = 14))` for presentations\n- Sort categories by value rather than alphabetically for clearer ranking visualization\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Ranking/Wordcloud.html\n", "source_file": "Ranking/Wordcloud.qmd", "skill_file": "skills/Ranking/Wordcloud_skill.md" - }, - { - "name": "Bizard Skills", - "category": "Misc", - "language": "R", - "packages": [], - "use_when": "Create a Bizard Skills visualization in R for biomedical data analysis and research publications.", - "tutorial_url": "https://openbiox.github.io/Bizard/Skills.html", - "skill": "# Skill: Bizard Skills (R)\n\n## Category\nMisc\n\n## When to Use\nCreate a Bizard Skills visualization in R for biomedical data analysis and research publications.\n\n## Required R Packages\n- (see tutorial)\n\n## Minimal Reproducible Code\n(See full tutorial for code)\n\n## Key Parameters\n- `fill`: Maps a variable to fill color for group comparison\n- `color`: Maps a variable to outline/point color\n\n## Tips\n- Adjust text size with `theme(text = element_text(size = 14))` for presentations\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/Skills.html\n", - "source_file": "Skills.qmd", - "skill_file": "skills/Misc/Skills_skill.md" - }, - { - "name": "About Us", - "category": "Misc", - "language": "R", - "packages": [], - "use_when": "Create a About Us visualization in R for biomedical data analysis and research publications.", - "tutorial_url": "https://openbiox.github.io/Bizard/About.html", - "skill": "# Skill: About Us (R)\n\n## Category\nMisc\n\n## When to Use\nCreate a About Us visualization in R for biomedical data analysis and research publications.\n\n## Required R Packages\n- (see tutorial)\n\n## Minimal Reproducible Code\n(See full tutorial for code)\n\n## Key Parameters\n- `fill`: Maps a variable to fill color for group comparison\n- `color`: Maps a variable to outline/point color\n\n## Tips\n- Adjust text size with `theme(text = element_text(size = 14))` for presentations\n- See the full tutorial for additional customization options and advanced examples\n\n## Full Tutorial\nhttps://openbiox.github.io/Bizard/About.html\n", - "source_file": "About.qmd", - "skill_file": "skills/Misc/About_skill.md" } ] \ No newline at end of file diff --git a/skills/index.json b/skills/index.json index 30a28520b..c79d2156f 100644 --- a/skills/index.json +++ b/skills/index.json @@ -3951,25 +3951,5 @@ "tutorial_url": "https://openbiox.github.io/Bizard/Ranking/Wordcloud.html", "source_file": "Ranking/Wordcloud.qmd", "skill_file": "skills/Ranking/Wordcloud_skill.md" - }, - { - "name": "Bizard Skills", - "category": "Misc", - "language": "R", - "packages": [], - "use_when": "Create a Bizard Skills visualization in R for biomedical data analysis and research publications.", - "tutorial_url": "https://openbiox.github.io/Bizard/Skills.html", - "source_file": "Skills.qmd", - "skill_file": "skills/Misc/Skills_skill.md" - }, - { - "name": "About Us", - "category": "Misc", - "language": "R", - "packages": [], - "use_when": "Create a About Us visualization in R for biomedical data analysis and research publications.", - "tutorial_url": "https://openbiox.github.io/Bizard/About.html", - "source_file": "About.qmd", - "skill_file": "skills/Misc/About_skill.md" } ] \ No newline at end of file