Clustering 3k PBMC with Scanpy

single-cell-scrna-scanpy-pbmc3k/clustering-3k-pbmc-with-scanpy

Author(s)
Bérénice Batut, Hans-Rudolf Hotz, Mehmet Tekman, Pavankumar Videm
version Version
3
last_modification Last updated
Nov 21, 2023
license License
CC-BY-4.0
galaxy-tags Tags
name:scRNA-seq
name:single-cell

Features

Tutorial
hands_on Clustering 3K PBMCs with Scanpy

Workflow Testing
Tests: ✅
Results: Not yet automated
FAIRness purl PURL
https://gxy.io/GTN:W00212
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\nBarcodes"];
  style 0 stroke:#2c3143,stroke-width:4px;
  1["ℹ️ Input Dataset\nGenes"];
  style 1 stroke:#2c3143,stroke-width:4px;
  2["ℹ️ Input Dataset\nMatrix"];
  style 2 stroke:#2c3143,stroke-width:4px;
  3["ℹ️ Input Dataset\nmito header"];
  style 3 stroke:#2c3143,stroke-width:4px;
  4["Import Anndata and loom"];
  2 -->|output| 4;
  0 -->|output| 4;
  1 -->|output| 4;
  5["Inspect AnnData"];
  4 -->|anndata| 5;
  6["Inspect AnnData"];
  4 -->|anndata| 6;
  7["Inspect AnnData"];
  4 -->|anndata| 7;
  8["Filter"];
  4 -->|anndata| 8;
  9["Inspect AnnData"];
  4 -->|anndata| 9;
  10["Inspect AnnData"];
  8 -->|anndata_out| 10;
  11["Select last"];
  10 -->|var| 11;
  12["Text reformatting"];
  11 -->|outfile| 12;
  13["Search in textfiles"];
  11 -->|outfile| 13;
  14["Replace Text"];
  12 -->|outfile| 14;
  15["Concatenate datasets"];
  3 -->|output| 15;
  14 -->|outfile| 15;
  16["Manipulate AnnData"];
  8 -->|anndata_out| 16;
  15 -->|out_file1| 16;
  17["Inspect and manipulate"];
  16 -->|anndata| 17;
  18["Inspect AnnData"];
  16 -->|anndata| 18;
  19["Plot"];
  17 -->|anndata_out| 19;
  4ab8b810-4e79-46b2-b740-74e267f5e209["Output\nout_png"];
  19 --> 4ab8b810-4e79-46b2-b740-74e267f5e209;
  style 4ab8b810-4e79-46b2-b740-74e267f5e209 stroke:#2c3143,stroke-width:4px;
  20["Filter"];
  17 -->|anndata_out| 20;
  21["Plot"];
  17 -->|anndata_out| 21;
  02478047-eb04-4a4e-b1ff-f3cb3c7673d5["Output\nout_png"];
  21 --> 02478047-eb04-4a4e-b1ff-f3cb3c7673d5;
  style 02478047-eb04-4a4e-b1ff-f3cb3c7673d5 stroke:#2c3143,stroke-width:4px;
  22["Plot"];
  17 -->|anndata_out| 22;
  3eb66a4a-79fe-43a3-889b-d43daeae5e17["Output\nout_png"];
  22 --> 3eb66a4a-79fe-43a3-889b-d43daeae5e17;
  style 3eb66a4a-79fe-43a3-889b-d43daeae5e17 stroke:#2c3143,stroke-width:4px;
  23["Filter"];
  20 -->|anndata_out| 23;
  24["Manipulate AnnData"];
  23 -->|anndata_out| 24;
  25["Normalize"];
  24 -->|anndata| 25;
  26["Inspect and manipulate"];
  25 -->|anndata_out| 26;
  27["Manipulate AnnData"];
  26 -->|anndata_out| 27;
  28["Filter"];
  27 -->|anndata| 28;
  29["Manipulate AnnData"];
  28 -->|anndata_out| 29;
  30["Plot"];
  28 -->|anndata_out| 30;
  31["Remove confounders"];
  29 -->|anndata| 31;
  32["Inspect and manipulate"];
  31 -->|anndata_out| 32;
  33["Cluster, infer trajectories and embed"];
  32 -->|anndata_out| 33;
  96cbb37e-e755-4479-9f14-f0e14f689868["Output\nanndata_out"];
  33 --> 96cbb37e-e755-4479-9f14-f0e14f689868;
  style 96cbb37e-e755-4479-9f14-f0e14f689868 stroke:#2c3143,stroke-width:4px;
  34["Plot"];
  33 -->|anndata_out| 34;
  35["Plot"];
  33 -->|anndata_out| 35;
  5dc45ef9-c56e-4dbd-9817-367c981a2041["Output\nout_png"];
  35 --> 5dc45ef9-c56e-4dbd-9817-367c981a2041;
  style 5dc45ef9-c56e-4dbd-9817-367c981a2041 stroke:#2c3143,stroke-width:4px;
  36["Inspect and manipulate"];
  33 -->|anndata_out| 36;
  37["Plot"];
  33 -->|anndata_out| 37;
  38["Plot"];
  33 -->|anndata_out| 38;
  39["Cluster, infer trajectories and embed"];
  36 -->|anndata_out| 39;
  40["Cluster, infer trajectories and embed"];
  39 -->|anndata_out| 40;
  41["Plot"];
  39 -->|anndata_out| 41;
  29513947-d16c-48b2-93ff-dd78cd99ecb7["Output\nout_png"];
  41 --> 29513947-d16c-48b2-93ff-dd78cd99ecb7;
  style 29513947-d16c-48b2-93ff-dd78cd99ecb7 stroke:#2c3143,stroke-width:4px;
  42["Inspect and manipulate"];
  40 -->|anndata_out| 42;
  43["Inspect and manipulate"];
  40 -->|anndata_out| 43;
  da91ad5a-dd9c-482e-accc-8e42d645e7b1["Output\nanndata_out"];
  43 --> da91ad5a-dd9c-482e-accc-8e42d645e7b1;
  style da91ad5a-dd9c-482e-accc-8e42d645e7b1 stroke:#2c3143,stroke-width:4px;
  44["Plot"];
  40 -->|anndata_out| 44;
  45["Inspect AnnData"];
  42 -->|anndata_out| 45;
  868797a3-ab74-45bf-96d1-84451a16f882["Output\nuns_rank_genes_groups_names"];
  45 --> 868797a3-ab74-45bf-96d1-84451a16f882;
  style 868797a3-ab74-45bf-96d1-84451a16f882 stroke:#2c3143,stroke-width:4px;
  46["Plot"];
  42 -->|anndata_out| 46;
  47["Plot"];
  43 -->|anndata_out| 47;
  2d042636-8fd1-42e3-af8d-83b4d613f075["Output\nout_png"];
  47 --> 2d042636-8fd1-42e3-af8d-83b4d613f075;
  style 2d042636-8fd1-42e3-af8d-83b4d613f075 stroke:#2c3143,stroke-width:4px;
  48["Manipulate AnnData"];
  43 -->|anndata_out| 48;
  51289df3-101f-4c6c-ae85-a8f46c2f33ea["Output\nanndata"];
  48 --> 51289df3-101f-4c6c-ae85-a8f46c2f33ea;
  style 51289df3-101f-4c6c-ae85-a8f46c2f33ea stroke:#2c3143,stroke-width:4px;
  49["Inspect and manipulate"];
  43 -->|anndata_out| 49;
  50["Inspect AnnData"];
  43 -->|anndata_out| 50;
  e617acd1-e59d-4f20-b39d-9dc0f832b0db["Output\nuns_rank_genes_groups_names"];
  50 --> e617acd1-e59d-4f20-b39d-9dc0f832b0db;
  style e617acd1-e59d-4f20-b39d-9dc0f832b0db stroke:#2c3143,stroke-width:4px;
  51["Plot"];
  43 -->|anndata_out| 51;
  983e7cee-7028-456c-9db2-bf0ad3e52de5["Output\nout_png"];
  51 --> 983e7cee-7028-456c-9db2-bf0ad3e52de5;
  style 983e7cee-7028-456c-9db2-bf0ad3e52de5 stroke:#2c3143,stroke-width:4px;
  52["Inspect clusters"];
  43 -->|anndata_out| 52;
  53["Plot"];
  43 -->|anndata_out| 53;
  734099bb-f454-4d8c-bc78-a269b0570c41["Output\nout_png"];
  53 --> 734099bb-f454-4d8c-bc78-a269b0570c41;
  style 734099bb-f454-4d8c-bc78-a269b0570c41 stroke:#2c3143,stroke-width:4px;
  54["Plot"];
  43 -->|anndata_out| 54;
  55["Plot"];
  43 -->|anndata_out| 55;
  39f2d4b6-f2e8-41b3-a00a-a2c5b54face2["Output\nout_png"];
  55 --> 39f2d4b6-f2e8-41b3-a00a-a2c5b54face2;
  style 39f2d4b6-f2e8-41b3-a00a-a2c5b54face2 stroke:#2c3143,stroke-width:4px;
  56["Plot"];
  48 -->|anndata| 56;
  e0979d1e-eb87-4a7b-904f-a5116c7b8fff["Output\nout_svg"];
  56 --> e0979d1e-eb87-4a7b-904f-a5116c7b8fff;
  style e0979d1e-eb87-4a7b-904f-a5116c7b8fff stroke:#2c3143,stroke-width:4px;
  57["Plot"];
  48 -->|anndata| 57;
  58["Plot"];
  48 -->|anndata| 58;
  bd14e644-2a32-4a81-bd83-042ee46d118a["Output\nout_png"];
  58 --> bd14e644-2a32-4a81-bd83-042ee46d118a;
  style bd14e644-2a32-4a81-bd83-042ee46d118a stroke:#2c3143,stroke-width:4px;
  59["Plot"];
  49 -->|anndata_out| 59;
  e9cf90db-ac42-4876-8abd-183fea271666["Output\ncollection_png"];
  59 --> e9cf90db-ac42-4876-8abd-183fea271666;
  style e9cf90db-ac42-4876-8abd-183fea271666 stroke:#2c3143,stroke-width:4px;
  60["Plot"];
  49 -->|anndata_out| 60;
  aef215b1-dbb4-447b-9297-c90536842c8e["Output\nout_png"];
  60 --> aef215b1-dbb4-447b-9297-c90536842c8e;
  style aef215b1-dbb4-447b-9297-c90536842c8e stroke:#2c3143,stroke-width:4px;
  61["Datamash"];
  52 -->|obs| 61;

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
  • Click on Workflow on the top menu bar of Galaxy. You will see a list of all your workflows.
  • Click on galaxy-upload Import at the top-right of the screen
  • 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”
  • 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
3 88dc62713 2023-11-21 16:41:05 add CC 4.0 license
2 f5d15e869 2023-11-21 16:28:21 add links to a control history and workflow
1 a0fbcfe2e 2023-11-21 16:08:06 add workflow and tests

For Admins

Installing the workflow tools

wget https://training.galaxyproject.org/training-material/topics/single-cell/tutorials/scrna-scanpy-pbmc3k/workflows/Clustering-3k-PBMC-with-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