jma1991/arrays

A Snakemake workflow to analyse Affymetrix expression arrays

Overview

Latest release: None, Last update: 2026-01-02

Linting: linting: failed, Formatting: formatting: failed

Topics: microarray

Deployment

Step 1: Install Snakemake and Snakedeploy

Snakemake and Snakedeploy are best installed via the Conda. 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/jma1991/arrays . --tag None

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

To run the workflow using apptainer/singularity, use

snakemake --cores all --sdm apptainer

To run the workflow using a combination of conda and apptainer/singularity for software deployment, use

snakemake --cores all --sdm conda apptainer

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

The workflow is configured by editing the following files:

  • config/config.yaml

  • config/samples.tsv

An error will be thrown if these files are missing or not formatted correctly.

Workflow config

The workflow config is a YAML file containing information about the workflow parameters:

  • Each line contains a name-value pair

  • Each name-value pair corresponds to a workflow parameter

The workflow config must contain the following pairs:

Name

Value

Example

samples

Path to sample sheet

config/samples.tsv

platform

Bioconductor platform data package

pd.hugene.1.0.st.v1

annotation

Bioconductor annotation data package

hugene10sttranscriptcluster.db

organism

Bioconductor organism data package

org.Hs.eg.db

contrasts

Contrast name and conditions in sample table

treatment-control

Contrasts for differential expression analysis are defined as shown below:

contrasts:
    treatment-control:
        - treatment
        - control

Below is an example of a valid workflow config:

samples: config/samples.tsv
platform: pd.hugene.1.0.st.v1
annotation: hugene10sttranscriptcluster.db
organism: org.Hs.eg.db
contrasts:
    treatment-control:
        - treatment
        - control

For this example, the workflow will install the platform, annotation, and organism Bioconductor packages and run a differential expression analysis on the treatment versus control conditions.

Sample table

The sample table is a TSV file containing data on the experimental design:

  • Each row corresponds to one sample

  • Each column corresponds to one attribute

For each sample, you must provide the following columns:

Column

Description

Example

sample

Sample name

S1

condition

Condition

treatment

filename

Array file

S1.CEL

To incorporate batch effects and blocking, you must add the following columns:

Column

Description

Example

batch

Batch effect

S1-B1

block

Sample pairing

S1-P1

Below is an example of a valid sample table:

sample  condition   filename batch  block
S1      C           S1.CEL   A      A   
S2      C           S2.CEL   A      B
S3      C           S1.CEL   B      C
S4      T           S2.CEL   A      A
S5      T           S3.CEL   A      B
S6      T           S4.CEL   B      C

Missing values can be specified by empty columns or by writing NA in the relevent entry.

Linting and formatting

Linting results

 1No validator found for JSON Schema version identifier 'http://json-schema.org/draft-06/schema#'
 2Defaulting to validator for JSON Schema version 'https://json-schema.org/draft/2020-12/schema'
 3Note that schema file may not be validated correctly.
 4No validator found for JSON Schema version identifier 'http://json-schema.org/draft-06/schema#'
 5Defaulting to validator for JSON Schema version 'https://json-schema.org/draft/2020-12/schema'
 6Note that schema file may not be validated correctly.
 7WorkflowError in file "/tmp/tmpwxtn7g5m/workflow/rules/common.smk", line 13:
 8Error validating row 0 of data frame.
 9ValidationError: 1 is not of type 'string'
10
11Failed validating 'type' in schema['properties']['batch']:
12    {'type': 'string'}
13
14On instance['batch']:
15    1

Formatting results

 1[DEBUG] 
 2[DEBUG] In file "/tmp/tmpwxtn7g5m/workflow/rules/qc.smk":  Formatted content is different from original
 3[DEBUG] 
 4[DEBUG] In file "/tmp/tmpwxtn7g5m/workflow/rules/handlers.smk":  Formatted content is different from original
 5[DEBUG] 
 6[DEBUG] In file "/tmp/tmpwxtn7g5m/workflow/Snakefile":  Formatted content is different from original
 7[DEBUG] 
 8[DEBUG] In file "/tmp/tmpwxtn7g5m/workflow/rules/common.smk":  Formatted content is different from original
 9[DEBUG] 
10[DEBUG] In file "/tmp/tmpwxtn7g5m/workflow/rules/preprocessing.smk":  Formatted content is different from original
11[DEBUG] 
12[DEBUG] 
13[DEBUG] In file "/tmp/tmpwxtn7g5m/workflow/rules/go.smk":  Formatted content is different from original
14[DEBUG] 
15[DEBUG] In file "/tmp/tmpwxtn7g5m/workflow/rules/resources.smk":  Formatted content is different from original
16[INFO] 7 file(s) would be changed 😬
17[INFO] 1 file(s) would be left unchanged 🎉
18
19snakefmt version: 0.11.2