GitHub
Back to all tutorials

Core analysis

scATAC-seq Analysis

This tutorial shows how to analyze one 10x Genomics scATAC-seq dataset in CellPilot, starting from a Cell Ranger ATAC output folder and ending with UMAP clusters, marker peaks, gene activity, and coverage plots.

Input data

This walkthrough uses the 10x Genomics 10k Human PBMCs ATAC v2 Chromium Controller dataset. Download the output and supplemental files from the 10x dataset page, or use the commands below for the files CellPilot can use directly.

Open the 10x Genomics dataset page

mkdir -p 10k_pbmc_atac
cd 10k_pbmc_atac

BASE=https://cf.10xgenomics.com/samples/cell-atac/2.1.0/10k_pbmc_ATACv2_nextgem_Chromium_Controller
SAMPLE=10k_pbmc_ATACv2_nextgem_Chromium_Controller

curl -O ${BASE}/${SAMPLE}_filtered_peak_bc_matrix.tar.gz
curl -O ${BASE}/${SAMPLE}_fragments.tsv.gz
curl -O ${BASE}/${SAMPLE}_fragments.tsv.gz.tbi
curl -O ${BASE}/${SAMPLE}_peak_annotation.tsv
curl -O ${BASE}/${SAMPLE}_singlecell.csv
curl -O ${BASE}/${SAMPLE}_summary.csv
curl -O ${BASE}/${SAMPLE}_web_summary.html

1. Prepare the folder

CellPilot expects standard Cell Ranger ATAC-style names. Some 10x downloads include the sample ID in every file name. After downloading and unzipping, remove that sample prefix so the folder looks like a standard output folder.

tar -xzf ${SAMPLE}_filtered_peak_bc_matrix.tar.gz

mv ${SAMPLE}_fragments.tsv.gz fragments.tsv.gz
mv ${SAMPLE}_fragments.tsv.gz.tbi fragments.tsv.gz.tbi
mv ${SAMPLE}_peak_annotation.tsv peak_annotation.tsv
mv ${SAMPLE}_singlecell.csv singlecell.csv
mv ${SAMPLE}_summary.csv summary.csv
mv ${SAMPLE}_web_summary.html web_summary.html

After cleanup, the selected folder should contain filtered_peak_bc_matrix/, peak_annotation.tsv, summary.csv, and optionally fragments.tsv.gz plus its index.

2. Load the dataset

  1. Open CellPilot.
  2. In the Data Type menu, choose scATAC-seq.
  3. In the Data menu, choose Single sample.
  4. Click Browse and select the prepared folder, not just the matrix file.
  5. Wait for CellPilot to read the peak matrix and start analysis.

CellPilot reads filtered_peak_bc_matrix/matrix.mtx or matrix.mtx.gz, barcodes.tsv, and peaks.bed. It also uses peak_annotation.tsv for gene activity and summary.csv to detect the genome build.

3. Let CellPilot run the ATAC pipeline

For single-sample scATAC-seq data, CellPilot runs a chromatin accessibility workflow: peak filtering, top feature selection, TF-IDF normalization, LSI by SVD, UMAP on LSI components, KNN/SNN graph construction, and Louvain clustering.

During processing, the status messages include steps such as selecting top features, running TF-IDF normalization, running LSI, running UMAP, and building KNN and clustering. When analysis finishes, the UMAP view is colored by ATAC clusters.

4. Inspect clusters and marker peaks

Use the UMAP view to inspect clusters, then ask CellPilot for marker peaks. Marker detection for ATAC uses the peak matrix directly and returns peaks enriched in the requested cluster.

Tell me about cluster 6
Find marker peaks for cluster 2
List 10 peaks
List cells

5. Plot gene activity

For scATAC-seq, CellPilot interprets gene plots as gene activity. It uses nearby peaks and peak annotations to summarize accessibility around the requested gene.

Plot gene activity for MS4A1
Violin plot gene activity for MS4A1
Dotplot MS4A1 CD3D
Change color to green black red

The color command changes the active gene activity or dot plot color scale, so use it after creating a feature plot or dot plot. If the genome build is detected from summary.csv, CellPilot uses it to choose the matching TSS reference for gene activity lookup.

6. View coverage tracks

If fragments.tsv.gz and fragments.tsv.gz.tbi are present in the selected folder, CellPilot can query fragments and show a coverage-style peak view for a gene region.

Coverage plot MS4A1

The coverage view uses fragment-level data and displays accessibility signal by cluster. If the fragments file is missing, gene activity UMAP and dot/violin plots can still work, but fragment coverage will not be available.

7. Adjust ATAC analysis parameters

CellPilot can rerun key ATAC steps from chat. UMAP commands rerun the ATAC UMAP pipeline, and clustering commands rerun Louvain clustering with the requested resolution.

Rerun ATAC UMAP with min dist = 0.4
Recluster the cells using resolution = 2.0