[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75CSDVVC6DBQ3K2A515F3WC":3,"skill-same:01M75CSDVVC6DBQ3K2A515F3WC":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M75CSDVVC6DBQ3K2A515F3WC","scanpy",null,"Standard single-cell RNA-seq analysis pipeline. Use for QC, normalization, dimensionality reduction (PCA\u002FUMAP\u002Ft-SNE), clustering, differential expression, and visualization. Best for exploratory scRNA-seq analysis with established workflows. For deep learning models use scvi-tools; for data format questions use anndata.","Lord1Egypt\u002Fai-skillforge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M7597M9CBBVAPX1CYE1KFTSM",2,"BSD-3-Clause","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fpython\u002Fskillforge_agent\u002Fskills\u002Fgemini\u002Fscanpy\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: scanpy\ndescription: Standard single-cell RNA-seq analysis pipeline. Use for QC, normalization, dimensionality reduction (PCA\u002FUMAP\u002Ft-SNE), clustering, differential expression, and visualization. Best for exploratory scRNA-seq analysis with established workflows. For deep learning models use scvi-tools; for data format questions use anndata.\nlicense: BSD-3-Clause\nmetadata:\n    skill-author: Lord1Egypt\n---\n\n# Scanpy: Single-Cell Analysis\n\n## Overview\n\nScanpy is a scalable Python toolkit for analyzing single-cell RNA-seq data, built on AnnData. Apply this skill for complete single-cell workflows including quality control, normalization, dimensionality reduction, clustering, marker gene identification, visualization, and trajectory analysis.\n\n## When to Use This Skill\n\nThis skill should be used when:\n- Analyzing single-cell RNA-seq data (.h5ad, 10X, CSV formats)\n- Performing quality control on scRNA-seq datasets\n- Creating UMAP, t-SNE, or PCA visualizations\n- Identifying cell clusters and finding marker genes\n- Annotating cell types based on gene expression\n- Conducting trajectory inference or pseudotime analysis\n- Generating publication-quality single-cell plots\n\n## Quick Start\n\n### Basic Import and Setup\n\n```python\nimport scanpy as sc\nimport pandas as pd\nimport numpy as np\n\n# Configure settings\nsc.settings.verbosity = 3\nsc.settings.set_figure_params(dpi=80, facecolor='white')\nsc.settings.figdir = '.\u002Ffigures\u002F'\n```\n\n### Loading Data\n\n```python\n# From 10X Genomics\nadata = sc.read_10x_mtx('path\u002Fto\u002Fdata\u002F')\nadata = sc.read_10x_h5('path\u002Fto\u002Fdata.h5')\n\n# From h5ad (AnnData format)\nadata = sc.read_h5ad('path\u002Fto\u002Fdata.h5ad')\n\n# From CSV\nadata = sc.read_csv('path\u002Fto\u002Fdata.csv')\n```\n\n### Understanding AnnData Structure\n\nThe AnnData object is the core data structure in scanpy:\n\n```python\nadata.X          # Expression matrix (cells × genes)\nadata.obs        # Cell metadata (DataFrame)\nadata.var        # Gene metadata (DataFrame)\nadata.uns        # Unstructured annotations (dict)\nadata.obsm       # Multi-dimensional cell data (PCA, UMAP)\nadata.raw        # Raw data backup\n\n# Access cell and gene names\nadata.obs_names  # Cell barcodes\nadata.var_names  # Gene names\n```\n\n## Standard Analysis Workflow\n\n### 1. Quality Control\n\nIdentify and filter low-quality cells and genes:\n\n```python\n# Identify mitochondrial genes\nadata.var['mt'] = adata.var_names.str.startswith('MT-')\n\n# Calculate QC metrics\nsc.pp.calculate_qc_metrics(adata, qc_vars=['mt'], inplace=True)\n\n# Visualize QC metrics\nsc.pl.violin(adata, ['n_genes_by_counts', 'total_counts', 'pct_counts_mt'],\n             jitter=0.4, multi_panel=True)\n\n# Filter cells and genes\nsc.pp.filter_cells(adata, min_genes=200)\nsc.pp.filter_genes(adata, min_cells=3)\nadata = adata[adata.obs.pct_counts_mt \u003C 5, :]  # Remove high MT% cells\n```\n\n**Use the QC script for automated analysis:**\n```bash\npython scripts\u002Fqc_analysis.py input_file.h5ad --output filtered.h5ad\n```\n\n### 2. Normalization and Preprocessing\n\n```python\n# Normalize to 10,000 counts per cell\nsc.pp.normalize_total(adata, target_sum=1e4)\n\n# Log-transform\nsc.pp.log1p(adata)\n\n# Save raw counts for later\nadata.raw = adata\n\n# Identify highly variable genes\nsc.pp.highly_variable_genes(adata, n_top_genes=2000)\nsc.pl.highly_variable_genes(adata)\n\n# Subset to highly variable genes\nadata = adata[:, adata.var.highly_variable]\n\n# Regress out unwanted variation\nsc.pp.regress_out(adata, ['total_counts', 'pct_counts_mt'])\n\n# Scale data\nsc.pp.scale(adata, max_value=10)\n```\n\n### 3. Dimensionality Reduction\n\n```python\n# PCA\nsc.tl.pca(adata, svd_solver='arpack')\nsc.pl.pca_variance_ratio(adata, log=True)  # Check elbow plot\n\n# Compute neighborhood graph\nsc.pp.neighbors(adata, n_neighbors=10, n_pcs=40)\n\n# UMAP for visualization\nsc.tl.umap(adata)\nsc.pl.umap(adata, color='leiden')\n\n# Alternative: t-SNE\nsc.tl.tsne(adata)\n```\n\n### 4. Clustering\n\n```python\n# Leiden clustering (recommended)\nsc.tl.leiden(adata, resolution=0.5)\nsc.pl.umap(adata, color='leiden', legend_loc='on data')\n\n# Try multiple resolutions to find optimal granularity\nfor res in [0.3, 0.5, 0.8, 1.0]:\n    sc.tl.leiden(adata, resolution=res, key_added=f'leiden_{res}')\n```\n\n### 5. Marker Gene Identification\n\n```python\n# Find marker genes for each cluster\nsc.tl.rank_genes_groups(adata, 'leiden', method='wilcoxon')\n\n# Visualize results\nsc.pl.rank_genes_groups(adata, n_genes=25, sharey=False)\nsc.pl.rank_genes_groups_heatmap(adata, n_genes=10)\nsc.pl.rank_genes_groups_dotplot(adata, n_genes=5)\n\n# Get results as DataFrame\nmarkers = sc.get.rank_genes_groups_df(adata, group='0')\n```\n\n### 6. Cell Type Annotation\n\n```python\n# Define marker genes for known cell types\nmarker_genes = ['CD3D', 'CD14', 'MS4A1', 'NKG7', 'FCGR3A']\n\n# Visualize markers\nsc.pl.umap(adata, color=marker_genes, use_raw=True)\nsc.pl.dotplot(adata, var_names=marker_genes, groupby='leiden')\n\n# Manual annotation\ncluster_to_celltype = {\n    '0': 'CD4 T cells',\n    '1': 'CD14+ Monocytes',\n    '2': 'B cells',\n    '3': 'CD8 T cells',\n}\nadata.obs['cell_type'] = adata.obs['leiden'].map(cluster_to_celltype)\n\n# Visualize annotated types\nsc.pl.umap(adata, color='cell_type', legend_loc='on data')\n```\n\n### 7. Save Results\n\n```python\n# Save processed data\nadata.write('results\u002Fprocessed_data.h5ad')\n\n# Export metadata\nadata.obs.to_csv('results\u002Fcell_metadata.csv')\nadata.var.to_csv('results\u002Fgene_metadata.csv')\n```\n\n## Common Tasks\n\n### Creating Publication-Quality Plots\n\n```python\n# Set high-quality defaults\nsc.settings.set_figure_params(dpi=300, frameon=False, figsize=(5, 5))\nsc.settings.file_format_figs = 'pdf'\n\n# UMAP with custom styling\nsc.pl.umap(adata, color='cell_type',\n           palette='Set2',\n           legend_loc='on data',\n           legend_fontsize=12,\n           legend_fontoutline=2,\n           frameon=False,\n           save='_publication.pdf')\n\n# Heatmap of marker genes\nsc.pl.heatmap(adata, var_names=genes, groupby='cell_type',\n              swap_axes=True, show_gene_labels=True,\n              save='_markers.pdf')\n\n# Dot plot\nsc.pl.dotplot(adata, var_names=genes, groupby='cell_type',\n              save='_dotplot.pdf')\n```\n\nRefer to `references\u002Fplotting_guide.md` for comprehensive visualization examples.\n\n### Trajectory Inference\n\n```python\n# PAGA (Partition-based graph abstraction)\nsc.tl.paga(adata, groups='leiden')\nsc.pl.paga(adata, color='leiden')\n\n# Diffusion pseudotime\nadata.uns['iroot'] = np.flatnonzero(adata.obs['leiden'] == '0')[0]\nsc.tl.dpt(adata)\nsc.pl.umap(adata, color='dpt_pseudotime')\n```\n\n### Differential Expression Between Conditions\n\n```python\n# Compare treated vs control within cell types\nadata_subset = adata[adata.obs['cell_type'] == 'T cells']\nsc.tl.rank_genes_groups(adata_subset, groupby='condition',\n                         groups=['treated'], reference='control')\nsc.pl.rank_genes_groups(adata_subset, groups=['treated'])\n```\n\n### Gene Set Scoring\n\n```python\n# Score cells for gene set expression\ngene_set = ['CD3D', 'CD3E', 'CD3G']\nsc.tl.score_genes(adata, gene_set, score_name='T_cell_score')\nsc.pl.umap(adata, color='T_cell_score')\n```\n\n### Batch Correction\n\n```python\n# ComBat batch correction\nsc.pp.combat(adata, key='batch')\n\n# Alternative: use Harmony or scVI (separate packages)\n```\n\n## Key Parameters to Adjust\n\n### Quality Control\n- `min_genes`: Minimum genes per cell (typically 200-500)\n- `min_cells`: Minimum cells per gene (typically 3-10)\n- `pct_counts_mt`: Mitochondrial threshold (typically 5-20%)\n\n### Normalization\n- `target_sum`: Target counts per cell (default 1e4)\n\n### Feature Selection\n- `n_top_genes`: Number of HVGs (typically 2000-3000)\n- `min_mean`, `max_mean`, `min_disp`: HVG selection parameters\n\n### Dimensionality Reduction\n- `n_pcs`: Number of principal components (check variance ratio plot)\n- `n_neighbors`: Number of neighbors (typically 10-30)\n\n### Clustering\n- `resolution`: Clustering granularity (0.4-1.2, higher = more clusters)\n\n## Common Pitfalls and Best Practices\n\n1. **Always save raw counts**: `adata.raw = adata` before filtering genes\n2. **Check QC plots carefully**: Adjust thresholds based on dataset quality\n3. **Use Leiden over Louvain**: More efficient and better results\n4. **Try multiple clustering resolutions**: Find optimal granularity\n5. **Validate cell type annotations**: Use multiple marker genes\n6. **Use `use_raw=True` for gene expression plots**: Shows original counts\n7. **Check PCA variance ratio**: Determine optimal number of PCs\n8. **Save intermediate results**: Long workflows can fail partway through\n\n## Bundled Resources\n\n### scripts\u002Fqc_analysis.py\nAutomated quality control script that calculates metrics, generates plots, and filters data:\n\n```bash\npython scripts\u002Fqc_analysis.py input.h5ad --output filtered.h5ad \\\n    --mt-threshold 5 --min-genes 200 --min-cells 3\n```\n\n### references\u002Fstandard_workflow.md\nComplete step-by-step workflow with detailed explanations and code examples for:\n- Data loading and setup\n- Quality control with visualization\n- Normalization and scaling\n- Feature selection\n- Dimensionality reduction (PCA, UMAP, t-SNE)\n- Clustering (Leiden, Louvain)\n- Marker gene identification\n- Cell type annotation\n- Trajectory inference\n- Differential expression\n\nRead this reference when performing a complete analysis from scratch.\n\n### references\u002Fapi_reference.md\nQuick reference guide for scanpy functions organized by module:\n- Reading\u002Fwriting data (`sc.read_*`, `adata.write_*`)\n- Preprocessing (`sc.pp.*`)\n- Tools (`sc.tl.*`)\n- Plotting (`sc.pl.*`)\n- AnnData structure and manipulation\n- Settings and utilities\n\nUse this for quick lookup of function signatures and common parameters.\n\n### references\u002Fplotting_guide.md\nComprehensive visualization guide including:\n- Quality control plots\n- Dimensionality reduction visualizations\n- Clustering visualizations\n- Marker gene plots (heatmaps, dot plots, violin plots)\n- Trajectory and pseudotime plots\n- Publication-quality customization\n- Multi-panel figures\n- Color palettes and styling\n\nConsult this when creating publication-ready figures.\n\n### assets\u002Fanalysis_template.py\nComplete analysis template providing a full workflow from data loading through cell type annotation. Copy and customize this template for new analyses:\n\n```bash\ncp assets\u002Fanalysis_template.py my_analysis.py\n# Edit parameters and run\npython my_analysis.py\n```\n\nThe template includes all standard steps with configurable parameters and helpful comments.\n\n## Additional Resources\n\n- **Official scanpy documentation**: https:\u002F\u002Fscanpy.readthedocs.io\u002F\n- **Scanpy tutorials**: https:\u002F\u002Fscanpy-tutorials.readthedocs.io\u002F\n- **scverse ecosystem**: https:\u002F\u002Fscverse.org\u002F (related tools: squidpy, scvi-tools, cellrank)\n- **Best practices**: Luecken & Theis (2019) \"Current best practices in single-cell RNA-seq\"\n\n## Tips for Effective Analysis\n\n1. **Start with the template**: Use `assets\u002Fanalysis_template.py` as a starting point\n2. **Run QC script first**: Use `scripts\u002Fqc_analysis.py` for initial filtering\n3. **Consult references as needed**: Load workflow and API references into context\n4. **Iterate on clustering**: Try multiple resolutions and visualization methods\n5. **Validate biologically**: Check marker genes match expected cell types\n6. **Document parameters**: Record QC thresholds and analysis settings\n7. **Save checkpoints**: Write intermediate results at key steps\n\n","# Scanpy: Single-Cell Analysis\n\n## Overview\n\nScanpy is a scalable Python toolkit for analyzing single-cell RNA-seq data, built on AnnData. Apply this skill for complete single-cell workflows including quality control, normalization, dimensionality reduction, clustering, marker gene identification, visualization, and trajectory analysis.\n\n## When to Use This Skill\n\nThis skill should be used when:\n- Analyzing single-cell RNA-seq data (.h5ad, 10X, CSV formats)\n- Performing quality control on scRNA-seq datasets\n- Creating UMAP, t-SNE, or PCA visualizations\n- Identifying cell clusters and finding marker genes\n- Annotating cell types based on gene expression\n- Conducting trajectory inference or pseudotime analysis\n- Generating publication-quality single-cell plots\n\n## Quick Start\n\n### Basic Import and Setup\n\n```python\nimport scanpy as sc\nimport pandas as pd\nimport numpy as np\n\n# Configure settings\nsc.settings.verbosity = 3\nsc.settings.set_figure_params(dpi=80, facecolor='white')\nsc.settings.figdir = '.\u002Ffigures\u002F'\n```\n\n### Loading Data\n\n```python\n# From 10X Genomics\nadata = sc.read_10x_mtx('path\u002Fto\u002Fdata\u002F')\nadata = sc.read_10x_h5('path\u002Fto\u002Fdata.h5')\n\n# From h5ad (AnnData format)\nadata = sc.read_h5ad('path\u002Fto\u002Fdata.h5ad')\n\n# From CSV\nadata = sc.read_csv('path\u002Fto\u002Fdata.csv')\n```\n\n### Understanding AnnData Structure\n\nThe AnnData object is the core data structure in scanpy:\n\n```python\nadata.X          # Expression matrix (cells × genes)\nadata.obs        # Cell metadata (DataFrame)\nadata.var        # Gene metadata (DataFrame)\nadata.uns        # Unstructured annotations (dict)\nadata.obsm       # Multi-dimensional cell data (PCA, UMAP)\nadata.raw        # Raw data backup\n\n# Access cell and gene names\nadata.obs_names  # Cell barcodes\nadata.var_names  # Gene names\n```\n\n## Standard Analysis Workflow\n\n### 1. Quality Control\n\nIdentify and filter low-quality cells and genes:\n\n```python\n# Identify mitochondrial genes\nadata.var['mt'] = adata.var_names.str.startswith('MT-')\n\n# Calculate QC metrics\nsc.pp.calculate_qc_metrics(adata, qc_vars=['mt'], inplace=True)\n\n# Visualize QC metrics\nsc.pl.violin(adata, ['n_genes_by_counts', 'total_counts', 'pct_counts_mt'],\n             jitter=0.4, multi_panel=True)\n\n# Filter cells and genes\nsc.pp.filter_cells(adata, min_genes=200)\nsc.pp.filter_genes(adata, min_cells=3)\nadata = adata[adata.obs.pct_counts_mt \u003C 5, :]  # Remove high MT% cells\n```\n\n**Use the QC script for automated analysis:**\n```bash\npython scripts\u002Fqc_analysis.py input_file.h5ad --output filtered.h5ad\n```\n\n### 2. Normalization and Preprocessing\n\n```python\n# Normalize to 10,000 counts per cell\nsc.pp.normalize_total(adata, target_sum=1e4)\n\n# Log-transform\nsc.pp.log1p(adata)\n\n# Save raw counts for later\nadata.raw = adata\n\n# Identify highly variable genes\nsc.pp.highly_variable_genes(adata, n_top_genes=2000)\nsc.pl.highly_variable_genes(adata)\n\n# Subset to highly variable genes\nadata = adata[:, adata.var.highly_variable]\n\n# Regress out unwanted variation\nsc.pp.regress_out(adata, ['total_counts', 'pct_counts_mt'])\n\n# Scale data\nsc.pp.scale(adata, max_value=10)\n```\n\n### 3. Dimensionality Reduction\n\n```python\n# PCA\nsc.tl.pca(adata, svd_solver='arpack')\nsc.pl.pca_variance_ratio(adata, log=True)  # Check elbow plot\n\n# Compute neighborhood graph\nsc.pp.neighbors(adata, n_neighbors=10, n_pcs=40)\n\n# UMAP for visualization\nsc.tl.umap(adata)\nsc.pl.umap(adata, color='leiden')\n\n# Alternative: t-SNE\nsc.tl.tsne(adata)\n```\n\n### 4. Clustering\n\n```python\n# Leiden clustering (recommended)\nsc.tl.leiden(adata, resolution=0.5)\nsc.pl.umap(adata, color='leiden', legend_loc='on data')\n\n# Try multiple resolutions to find optimal granularity\nfor res in [0.3, 0.5, 0.8, 1.0]:\n    sc.tl.leiden(adata, resolution=res, key_added=f'leiden_{res}')\n```\n\n### 5. Marker Gene Identification\n\n```python\n# Find marker genes for each cluster\nsc.tl.rank_genes_groups(adata, 'leiden', method='wilcoxon')\n\n# Visualize results\nsc.pl.rank_genes_groups(adata, n_genes=25, sharey=False)\nsc.pl.rank_genes_groups_heatmap(adata, n_genes=10)\nsc.pl.rank_genes_groups_dotplot(adata, n_genes=5)\n\n# Get results as DataFrame\nmarkers = sc.get.rank_genes_groups_df(adata, group='0')\n```\n\n### 6. Cell Type Annotation\n\n```python\n# Define marker genes for known cell types\nmarker_genes = ['CD3D', 'CD14', 'MS4A1', 'NKG7', 'FCGR3A']\n\n# Visualize markers\nsc.pl.umap(adata, color=marker_genes, use_raw=True)\nsc.pl.dotplot(adata, var_names=marker_genes, groupby='leiden')\n\n# Manual annotation\ncluster_to_celltype = {\n    '0': 'CD4 T cells',\n    '1': 'CD14+ Monocytes',\n    '2': 'B cells',\n    '3': 'CD8 T cells',\n}\nadata.obs['cell_type'] = adata.obs['leiden'].map(cluster_to_celltype)\n\n# Visualize annotated types\nsc.pl.umap(adata, color='cell_type', legend_loc='on data')\n```\n\n### 7. Save Results\n\n```python\n# Save processed data\nadata.write('results\u002Fprocessed_data.h5ad')\n\n# Export metadata\nadata.obs.to_csv('results\u002Fcell_metadata.csv')\nadata.var.to_csv('results\u002Fgene_metadata.csv')\n```\n\n## Common Tasks\n\n### Creating Publication-Quality Plots\n\n```python\n# Set high-quality defaults\nsc.settings.set_figure_params(dpi=300, frameon=False, figsize=(5, 5))\nsc.settings.file_format_figs = 'pdf'\n\n# UMAP with custom styling\nsc.pl.umap(adata, color='cell_type',\n           palette='Set2',\n           legend_loc='on data',\n           legend_fontsize=12,\n           legend_fontoutline=2,\n           frameon=False,\n           save='_publication.pdf')\n\n# Heatmap of marker genes\nsc.pl.heatmap(adata, var_names=genes, groupby='cell_type',\n              swap_axes=True, show_gene_labels=True,\n              save='_markers.pdf')\n\n# Dot plot\nsc.pl.dotplot(adata, var_names=genes, groupby='cell_type',\n              save='_dotplot.pdf')\n```\n\nRefer to `references\u002Fplotting_guide.md` for comprehensive visualization examples.\n\n### Trajectory Inference\n\n```python\n# PAGA (Partition-based graph abstraction)\nsc.tl.paga(adata, groups='leiden')\nsc.pl.paga(adata, color='leiden')\n\n# Diffusion pseudotime\nadata.uns['iroot'] = np.flatnonzero(adata.obs['leiden'] == '0')[0]\nsc.tl.dpt(adata)\nsc.pl.umap(adata, color='dpt_pseudotime')\n```\n\n### Differential Expression Between Conditions\n\n```python\n# Compare treated vs control within cell types\nadata_subset = adata[adata.obs['cell_type'] == 'T cells']\nsc.tl.rank_genes_groups(adata_subset, groupby='condition',\n                         groups=['treated'], reference='control')\nsc.pl.rank_genes_groups(adata_subset, groups=['treated'])\n```\n\n### Gene Set Scoring\n\n```python\n# Score cells for gene set expression\ngene_set = ['CD3D', 'CD3E', 'CD3G']\nsc.tl.score_genes(adata, gene_set, score_name='T_cell_score')\nsc.pl.umap(adata, color='T_cell_score')\n```\n\n### Batch Correction\n\n```python\n# ComBat batch correction\nsc.pp.combat(adata, key='batch')\n\n# Alternative: use Harmony or scVI (separate packages)\n```\n\n## Key Parameters to Adjust\n\n### Quality Control\n- `min_genes`: Minimum genes per cell (typically 200-500)\n- `min_cells`: Minimum cells per gene (typically 3-10)\n- `pct_counts_mt`: Mitochondrial threshold (typically 5-20%)\n\n### Normalization\n- `target_sum`: Target counts per cell (default 1e4)\n\n### Feature Selection\n- `n_top_genes`: Number of HVGs (typically 2000-3000)\n- `min_mean`, `max_mean`, `min_disp`: HVG selection parameters\n\n### Dimensionality Reduction\n- `n_pcs`: Number of principal components (check variance ratio plot)\n- `n_neighbors`: Number of neighbors (typically 10-30)\n\n### Clustering\n- `resolution`: Clustering granularity (0.4-1.2, higher = more clusters)\n\n## Common Pitfalls and Best Practices\n\n1. **Always save raw counts**: `adata.raw = adata` before filtering genes\n2. **Check QC plots carefully**: Adjust thresholds based on dataset quality\n3. **Use Leiden over Louvain**: More efficient and better results\n4. **Try multiple clustering resolutions**: Find optimal granularity\n5. **Validate cell type annotations**: Use multiple marker genes\n6. **Use `use_raw=True` for gene expression plots**: Shows original counts\n7. **Check PCA variance ratio**: Determine optimal number of PCs\n8. **Save intermediate results**: Long workflows can fail partway through\n\n## Bundled Resources\n\n### scripts\u002Fqc_analysis.py\nAutomated quality control script that calculates metrics, generates plots, and filters data:\n\n```bash\npython scripts\u002Fqc_analysis.py input.h5ad --output filtered.h5ad \\\n    --mt-threshold 5 --min-genes 200 --min-cells 3\n```\n\n### references\u002Fstandard_workflow.md\nComplete step-by-step workflow with detailed explanations and code examples for:\n- Data loading and setup\n- Quality control with visualization\n- Normalization and scaling\n- Feature selection\n- Dimensionality reduction (PCA, UMAP, t-SNE)\n- Clustering (Leiden, Louvain)\n- Marker gene identification\n- Cell type annotation\n- Trajectory inference\n- Differential expression\n\nRead this reference when performing a complete analysis from scratch.\n\n### references\u002Fapi_reference.md\nQuick reference guide for scanpy functions organized by module:\n- Reading\u002Fwriting data (`sc.read_*`, `adata.write_*`)\n- Preprocessing (`sc.pp.*`)\n- Tools (`sc.tl.*`)\n- Plotting (`sc.pl.*`)\n- AnnData structure and manipulation\n- Settings and utilities\n\nUse this for quick lookup of function signatures and common parameters.\n\n### references\u002Fplotting_guide.md\nComprehensive visualization guide including:\n- Quality control plots\n- Dimensionality reduction visualizations\n- Clustering visualizations\n- Marker gene plots (heatmaps, dot plots, violin plots)\n- Trajectory and pseudotime plots\n- Publication-quality customization\n- Multi-panel figures\n- Color palettes and styling\n\nConsult this when creating publication-ready figures.\n\n### assets\u002Fanalysis_template.py\nComplete analysis template providing a full workflow from data loading through cell type annotation. Copy and customize this template for new analyses:\n\n```bash\ncp assets\u002Fanalysis_template.py my_analysis.py\n# Edit parameters and run\npython my_analysis.py\n```\n\nThe template includes all standard steps with configurable parameters and helpful comments.\n\n## Additional Resources\n\n- **Official scanpy documentation**: https:\u002F\u002Fscanpy.readthedocs.io\u002F\n- **Scanpy tutorials**: https:\u002F\u002Fscanpy-tutorials.readthedocs.io\u002F\n- **scverse ecosystem**: https:\u002F\u002Fscverse.org\u002F (related tools: squidpy, scvi-tools, cellrank)\n- **Best practices**: Luecken & Theis (2019) \"Current best practices in single-cell RNA-seq\"\n\n## Tips for Effective Analysis\n\n1. **Start with the template**: Use `assets\u002Fanalysis_template.py` as a starting point\n2. **Run QC script first**: Use `scripts\u002Fqc_analysis.py` for initial filtering\n3. **Consult references as needed**: Load workflow and API references into context\n4. **Iterate on clustering**: Try multiple resolutions and visualization methods\n5. **Validate biologically**: Check marker genes match expected cell types\n6. **Document parameters**: Record QC thresholds and analysis settings\n7. **Save checkpoints**: Write intermediate results at key steps\n\n",{"name":5,"license":15,"metadata":24,"description":7},{"skill-author":9},"main","3f88e1b76af67701a6405069a542e21a997d2868","python\u002Fskillforge_agent\u002Fskills\u002Fgemini\u002Fscanpy",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-05 10:16:24",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Lord1Egypt\u002Fai-skillforge --skill scanpy",{"tool":39,"command":40},"bunx","bunx skills add Lord1Egypt\u002Fai-skillforge --skill scanpy",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fai-skillforge --skill scanpy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fpython\u002Fskillforge_agent\u002Fskills\u002Fgemini\u002Fscanpy\u002FSKILL.md",true,[47,53,59,63,67],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"assets\u002Fanalysis_template.py","SCRIPT","脚本",9515,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fpython\u002Fskillforge_agent\u002Fskills\u002Fgemini\u002Fscanpy\u002Fassets\u002Fanalysis_template.py",{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fapi_reference.md","REFERENCE","参考文档",7415,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fpython\u002Fskillforge_agent\u002Fskills\u002Fgemini\u002Fscanpy\u002Freferences\u002Fapi_reference.md",{"path":60,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fplotting_guide.md",9695,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fpython\u002Fskillforge_agent\u002Fskills\u002Fgemini\u002Fscanpy\u002Freferences\u002Fplotting_guide.md",{"path":64,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fstandard_workflow.md",5529,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fpython\u002Fskillforge_agent\u002Fskills\u002Fgemini\u002Fscanpy\u002Freferences\u002Fstandard_workflow.md",{"path":68,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":69,"sourceHtmlUrl":70},"scripts\u002Fqc_analysis.py",6706,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fpython\u002Fskillforge_agent\u002Fskills\u002Fgemini\u002Fscanpy\u002Fscripts\u002Fqc_analysis.py",[72,80,87,94,101,108],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M75GWTHWA52GYQKS347FF6CD","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M75GW9FBP9NAFBSNVJ23RHSX","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Fwhat-if-oracle\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M75GW351MZZQ1V7207PDCX5D","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Fvenue-templates\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M75GVYGMAZDV2NHWSV6PP6TK","vaex","Use this skill for processing and analyzing large tabular datasets (billions of rows) that exceed available RAM. Vaex excels at out-of-core DataFrame operations, lazy evaluation, fast aggregations, efficient visualization of big data, and machine learning on large datasets. Apply when users need to work with large CSV\u002FHDF5\u002FArrow\u002FParquet files, perform fast statistics on massive datasets, create visualizations of big data, or build ML pipelines that do not fit in memory.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Fvaex\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M75GVS0ADH3DZ3QB564EVYC9","usfiscaldata","Query the U.S. Treasury Fiscal Data API for federal financial data including national debt, government spending, revenue, interest rates, exchange rates, and savings bonds. Access 54 datasets and 182 data tables with no API key required. Use when working with U.S. federal fiscal data, national debt tracking (Debt to the Penny), Daily Treasury Statements, Monthly Treasury Statements, Treasury securities auctions, interest rates on Treasury securities, foreign exchange rates, savings bonds, or any U.S. government financial statistics.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Fusfiscaldata\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M75GVDTBSXRQ4Q11RVJQC56M","treatment-plans","Generate concise (3-4 page), focused medical treatment plans in LaTeX\u002FPDF format for all clinical specialties. Supports general medical treatment, rehabilitation therapy, mental health care, chronic disease management, perioperative care, and pain management. Includes SMART goal frameworks, evidence-based interventions with minimal text citations, regulatory compliance (HIPAA), and professional formatting. Prioritizes brevity and clinical actionability.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Ftreatment-plans\u002FSKILL.md",[],[]]