Batch Correction - Scanpy

single-cell-scrna_batch_correction/workflow-scanpy

Author(s)
Marisa Loach
version Version
1
last_modification Last updated
Jul 9, 2026
license License
CC-BY-4.0
galaxy-tags Tags
name:singlecell
name:scanpy

Features
Tutorial
hands_on Batch Correction and Integration with Seurat or Scanpy
workflow Other workflows associated with this material
Workflow Testing
Tests: ✅
Results: Not yet automated
FAIRness purl PURL
https://gxy.io/GTN:W00382
RO-Crate logo with flask Download Workflow RO-Crate Workflowhub cloud with gears logo View on WorkflowHub
Launch in Tutorial Mode question
galaxy-download Download
flowchart TD
  0["ℹ️ Input Dataset\nInput_AnnData"];
  style 0 stroke:#2c3143,stroke-width:4px;
  1["Inspect AnnData"];
  0 -->|output| 1;
  d7e307be-d4f6-4936-bff2-3c2e4efb91af["Output\nInspect_Input_Anndata"];
  1 --> d7e307be-d4f6-4936-bff2-3c2e4efb91af;
  style d7e307be-d4f6-4936-bff2-3c2e4efb91af stroke:#2c3143,stroke-width:4px;
  2["Inspect AnnData"];
  0 -->|output| 2;
  3["Scanpy normalize"];
  0 -->|output| 3;
  4["Count"];
  2 -->|obs| 4;
  5["Scanpy Inspect and manipulate"];
  3 -->|anndata_out| 5;
  6["Scanpy filter"];
  5 -->|anndata_out| 6;
  7["Find HVGs by Batch"];
  5 -->|anndata_out| 7;
  8["Scanpy Inspect and manipulate"];
  6 -->|anndata_out| 8;
  9["Scanpy Inspect and manipulate"];
  7 -->|anndata_out| 9;
  10["Scanpy cluster, embed"];
  8 -->|anndata_out| 10;
  11["Scanpy cluster, embed"];
  9 -->|anndata_out| 11;
  12["Scanpy Inspect and manipulate"];
  10 -->|anndata_out| 12;
  13["Harmony Integration"];
  11 -->|anndata_out| 13;
  14["Scanpy cluster, embed"];
  12 -->|anndata_out| 14;
  15["Scanpy Inspect and manipulate"];
  13 -->|anndata_out| 15;
  16["Unintegrated AnnData"];
  14 -->|anndata_out| 16;
  17["Scanpy cluster, embed"];
  15 -->|anndata_out| 17;
  18["UMAP Plots before Batch Correction"];
  16 -->|anndata_out| 18;
  bc97da67-3d78-4944-bd86-fde12db9bc6f["Output\nUMAP_before_Integrate"];
  18 --> bc97da67-3d78-4944-bd86-fde12db9bc6f;
  style bc97da67-3d78-4944-bd86-fde12db9bc6f stroke:#2c3143,stroke-width:4px;
  19["Integrated AnnData"];
  17 -->|anndata_out| 19;
  20["UMAP Plot after Batch Correction"];
  19 -->|anndata_out| 20;
  84edd00a-d986-4ffc-92be-4e1ccd4e0daf["Output\nUMAP_after_Integrate"];
  20 --> 84edd00a-d986-4ffc-92be-4e1ccd4e0daf;
  style 84edd00a-d986-4ffc-92be-4e1ccd4e0daf stroke:#2c3143,stroke-width:4px;

Inputs

Input Label
Input_Anndata Input_AnnData

Outputs

From Output Label
toolshed.g2.bx.psu.edu/repos/iuc/anndata_inspect/anndata_inspect/0.11.4+galaxy3 Inspect AnnData
toolshed.g2.bx.psu.edu/repos/iuc/scanpy_plot/scanpy_plot/1.11.5+galaxy0 Scanpy plot UMAP Plots before Batch Correction
toolshed.g2.bx.psu.edu/repos/iuc/scanpy_plot/scanpy_plot/1.11.5+galaxy0 Scanpy plot UMAP Plot after Batch Correction

Tools

Tool Links
Count1
toolshed.g2.bx.psu.edu/repos/iuc/anndata_inspect/anndata_inspect/0.11.4+galaxy3 View in ToolShed
toolshed.g2.bx.psu.edu/repos/iuc/scanpy_cluster_reduce_dimension/scanpy_cluster_reduce_dimension/1.11.5+galaxy0 View in ToolShed
toolshed.g2.bx.psu.edu/repos/iuc/scanpy_filter/scanpy_filter/1.11.5+galaxy0 View in ToolShed
toolshed.g2.bx.psu.edu/repos/iuc/scanpy_inspect/scanpy_inspect/1.11.5+galaxy0 View in ToolShed
toolshed.g2.bx.psu.edu/repos/iuc/scanpy_normalize/scanpy_normalize/1.11.5+galaxy0 View in ToolShed
toolshed.g2.bx.psu.edu/repos/iuc/scanpy_plot/scanpy_plot/1.11.5+galaxy0 View in ToolShed
toolshed.g2.bx.psu.edu/repos/iuc/scanpy_remove_confounders/scanpy_remove_confounders/1.11.5+galaxy0 View in ToolShed

To use these workflows in Galaxy you can either click the links to download the workflows, or you can right-click and copy the link to the workflow which can be used in the Galaxy form to import workflows.

Importing into Galaxy

Below are the instructions for importing these workflows directly into your Galaxy server of choice to start using them!
Hands On: Importing a workflow
  1. Click on galaxy-workflows-activity Workflows in the Galaxy activity bar (on the left side of the screen, or in the top menu bar of older Galaxy instances). You will see a list of all your workflows
  2. Click on galaxy-upload Import at the top-right of the screen
  3. Provide your workflow
    • Option 1: Paste the URL of the workflow into the box labelled “Archived Workflow URL”
    • Option 2: Upload the workflow file in the box labelled “Archived Workflow File”
  4. Click the Import workflow button

Below is a short video demonstrating how to import a workflow from GitHub using this procedure:

Video: Importing a workflow from URL

Version History

Version Commit Time Comments
2 d6d1ca722 2026-06-05 20:02:29 Update input/output labels in Scanpy workflow
1 ac0be9773 2026-06-05 19:12:11 Add workflow for Scanpy

For Admins

Installing the workflow tools

wget https://training.galaxyproject.org/training-material/topics/single-cell/tutorials/scrna_batch_correction/workflows/workflow_Scanpy.ga -O workflow.ga
workflow-to-tools -w workflow.ga -o tools.yaml
shed-tools install -g GALAXY -a API_KEY -t tools.yaml
workflow-install -g GALAXY -a API_KEY -w workflow.ga --publish-workflows