epigen/unsupervised_analysis
A general purpose Snakemake workflow and MrBiomics module to perform unsupervised analyses (dimensionality reduction & cluster analysis) and visualizations of high-dimensional data.
Overview
Latest release: v4.0.1, Last update: 2026-05-18
Share link: https://snakemake.github.io/snakemake-workflow-catalog?wf=epigen/unsupervised_analysis
Quality control: linting: passed formatting: passed
Topics: data-science high-dimensional-data snakemake workflow unsupervised-learning principal-component-analysis umap pca visualization clustering data-visualization dimensionality-reduction heatmap densmap cluster-analysis cluster-validation clustering-algorithm clustree leiden-algorithm
Deployment
Step 1: Install Snakemake and Snakedeploy
Snakemake and Snakedeploy are best installed via the Conda package manager. It is recommended to install conda via Miniforge. Run
conda create -c conda-forge -c bioconda -c nodefaults --name snakemake snakemake snakedeploy
to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via
conda activate snakemake
For other installation methods, refer to the Snakemake and Snakedeploy documentation.
Step 2: Deploy workflow
With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:
mkdir -p path/to/project-workdir
cd path/to/project-workdir
In all following steps, we will assume that you are inside of that directory. Then run
snakedeploy deploy-workflow https://github.com/epigen/unsupervised_analysis . --tag v4.0.1
Snakedeploy will create two folders, workflow and config. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.
Step 3: Configure workflow
To configure the workflow, adapt config/config.yml to your needs following the instructions below.
Step 4: Run workflow
The deployment method is controlled using the --software-deployment-method (short --sdm) argument.
To run the workflow with automatic deployment of all required software via conda/mamba, use
snakemake --cores all --sdm conda
Snakemake will automatically detect the main Snakefile in the workflow subfolder and execute the workflow module that has been defined by the deployment in step 2.
For further options such as cluster and cloud execution, see the docs.
Step 5: Generate report
After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using
snakemake --report report.zip
Configuration
The following section is imported from the workflow’s config/README.md.
Configuration
You need one configuration file to configure the analyses and one annotation file describing the data to run the complete workflow. If in doubt read the comments in the config and/or try the default values. We provide a full example including data and configuration in config/ and test/ as a starting point.
project configuration (
config/config.yaml): Different for every project and configures the analyses to be performed.sample annotation (
config/annotation.csv): CSV file consisting of four mandatory columns.name: A unique name for the dataset (tip: keep it short but descriptive).
data: Path to the tabular data as a comma-separated table (CSV).
metadata: Path to the metadata as a comma-separated table (CSV) with the first column being the index/identifier of each observation/sample and every other column metadata for the respective observation (either numeric or categorical, not mixed). No NaN or empty values allowed, and no special characters (all except a-z, 0-9,
_) in the index.samples_by_features: Boolean indicator if the data matrix is observations/samples (rows) x features (columns): 0==no, 1==yes.
Set workflow-specific resources or command line arguments (CLI) in the workflow profile workflow/profiles/default.config.yaml, which supersedes global Snakemake profiles.
Provided JSON Schemas for the workflow config and annotation files are used by Snakemake for validation before execution.
Workflow parameters
The following table is automatically parsed from the workflow’s config.schema.y(a)ml file.
Parameter |
Type |
Description |
Required |
Default |
|---|---|---|---|---|
mem |
integer |
Memory limit in MB used by workflow rules. |
32000 |
|
threads |
integer |
Default thread count used by workflow rules. |
2 |
|
annotation |
string |
Path to the sample annotation CSV file. |
yes |
|
result_path |
string |
Base output directory for workflow results. |
yes |
|
project_name |
string |
Short project identifier used in reports and exported config copies. |
yes |
|
pca |
yes |
|||
. n_components |
Number of components, explained variance fraction, or “mle”. |
yes |
||
. svd_solver |
string |
yes |
||
umap |
yes |
|||
. metrics |
array |
yes |
||
. n_neighbors |
array |
yes |
||
. min_dist |
array |
yes |
||
. n_components |
array |
yes |
||
. densmap |
integer |
yes |
||
. connectivity |
integer |
yes |
||
. diagnostics |
integer |
yes |
||
heatmap |
yes |
|||
. metrics |
array |
yes |
||
. hclust_methods |
array |
yes |
||
. n_observations |
yes |
|||
. n_features |
yes |
|||
leiden |
yes |
|||
. metrics |
array |
yes |
||
. n_neighbors |
array |
yes |
||
. partition_types |
array |
yes |
||
. resolutions |
array |
yes |
||
. n_iterations |
integer |
yes |
||
clustree |
yes |
|||
. count_filter |
integer |
yes |
||
. prop_filter |
number |
yes |
||
. layout |
string |
yes |
||
. categorical_label_option |
string |
yes |
||
. numerical_aggregation_option |
string |
yes |
||
sample_proportion |
number |
Set to 0 to skip internal cluster validation. |
yes |
|
metadata_of_interest |
array |
yes |
[] |
|
coord_fixed |
integer |
yes |
||
scatterplot2d |
yes |
|||
. size |
number |
yes |
||
. alpha |
number |
yes |
||
features_to_plot |
array |
yes |
[] |
Linting and formatting
Linting results
All tests passed!
Formatting results
All tests passed!