Snakemake workflow for running cellphonedb on a combined annotated dataset (AnnData object) saved as h5ad file. Workflow structure is modelled after cookiecutter snakemake template.
- Rachel Ng (@racng)
If you use this workflow in a paper, don't forget to give credits to the authors by citing the URL of this (original) repository.
- Create a new github repository using this workflow as a template.
- Clone the newly created repository to your local system, into the place where you want to perform the data analysis.
Configure the workflow according to your needs via editing config.yaml.
outdir: Output directory (default:output)adata: Path toh5adfilegene: Key in adata.var that contains gene ids. Putindexif using adata.var_namescelltype:key: Key in adata.obs that contains cell type labelscelltype:groups: Cell types to use (Put[]if using all)sample:key: Key in adata.obs that contains sample labelssample:groups: Samples to analyze (Put[]if using all)cellphonedb:args:: Additional arguments for the cellphonedb cli (counts-data, iterations, threshold, threads)
Install Snakemake using conda and mamba:
conda install -c conda-forge mamba
mamba create -c conda-forge -c bioconda -n snakemake snakemake
For installation details, see the instructions in the Snakemake documentation.
Activate the conda environment:
conda activate snakemake
Test your configuration by performing a dry-run via
snakemake --use-conda -n
Execute the workflow locally using $N cores (or 'all' cores)
snakemake --use-conda --cores $N
Use alternate config files using the --configfile option.
See the Snakemake documentation for further details.
Cellphonedb outputs are organized by sample subfolders under the specified outdir.