Wheeler-Lab/InDelCoordinateCorrection

None

Overview

Topics:

Latest release: None, Last update: 2023-06-23

Linting: linting: failed, Formatting:formatting: failed

Deployment

Step 1: Install Snakemake and Snakedeploy

Snakemake and Snakedeploy are best installed via the Mamba package manager (a drop-in replacement for conda). If you have neither Conda nor Mamba, it is recommended to install Miniforge. More details regarding Mamba can be found here.

When using Mamba, run

mamba create -c conda-forge -c bioconda --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

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/Wheeler-Lab/InDelCoordinateCorrection . --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

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

In order to use this workflow, you need to customise the given example config/config.yaml file for your purposes. Please see the example here:

samples_directory: resources/samples # This could be customized to any directory in which the sequencing samples are stored.
experiments:
  reference:
    genome_sequence: resources/reference_genome_sequence.fasta     # The fasta and gff files need to be provided (TriTrypDB sequence files can be automatically downloaded).
    genome_annotations: resources/reference_genome_annotations.gff

cellline1: parent: reference samples: - SRR0000000 # samples can alternatively be SRA accession numbers, which will be automatically downloaded. - cellline1_run2

cellline2: parent: reference samples: - cellline2_run1 # This is assumed to refer to the paired end fastq files <samples_directory>/cellline2/cellline2_run1_1.fq.gz and <samples_directory>/cellline2/cellline2_run1_2.fq.gz - cellline2_run2

cellline1_clone1: parent: cellline1 samples: - cellline1_clone1_run1 - cellline1_clone1_run2

cellline1_clone2: parent: cellline1 samples: - cellline1_clone2_run1 - cellline1_clone2_run2

cellline2_clone1: parent: cellline2 samples: - cellline2_clone1_run1 - cellline2_clone1_run2

cellline2_clone2: parent: cellline2 samples: - cellline2_clone2_run1 - cellline2_clone2_run2

Details

  • samples_directory: This points to the location of the sequencing samples fastq files. It could be anywhere, but is usually in resources/samples.
  • experiments: This is a list of cell lines describing the relationship tree we want to analyse. Every entry underneath is the name of a cell line.
  • genome_sequence: For reference genomes, this is the location of the .fasta file holding the genome sequence. It's not needed for any other entry in the experiments list, only for reference genomes. In special cases, this can be downloaded automatically (see below).
  • genome_annotations: Similar to genome_sequence, this is the location of the .gff file holding the genome annotation features.
  • parent: This gives the name of the cell line entry of the parent of the current cell line. If it is not given, the current entry is assumed to be a reference genome.
  • samples: Holds a list of sequencing samples associated with this cell line entry. Any entry in this list can be in the form of SRR123456789 when it is assumed to be an SRA accession number and will be automatically downloaded. Otherwise, if given as cellline1_clone1_run1, it is assumed to refer to the paired-end fastq files in the location <samples_directory>/cellline1_clone1_run1_1.fq.gz and <samples_directory>/cellline1_clone1_run1_2.fq.gz.

Automatic downloading from TriTrypDB

If the genome_sequence entry is of the form TriTrypDB-<version>_<organism>_Genome.fasta, it will be automatically downloaded from TriTrypDB.

Linting and formatting

Linting results

Lints for snakefile /tmp/tmpdnafr6_8/workflow/Snakefile:
    * Mixed rules and functions in same snakefile.:
      Small one-liner functions used only once should be defined as lambda
      expressions. Other functions should be collected in a common module, e.g.
      'rules/common.smk'. This makes the workflow steps more readable.
      Also see:
      https://snakemake.readthedocs.io/en/latest/snakefiles/modularization.html#includes

Lints for rule download_tryptrypdb_fasta (line 22, /tmp/tmpdnafr6_8/workflow/Snakefile):
    * No log directive defined:
      Without a log directive, all output will be printed to the terminal. In
      distributed environments, this means that errors are harder to discover.
      In local environments, output of concurrent jobs will be mixed and become
      unreadable.
      Also see:
      https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#log-files
    * Specify a conda environment or container for each rule.:
      This way, the used software for each specific step is documented, and the
      workflow can be executed on any machine without prerequisites.
      Also see:

... (truncated)

Formatting results

[DEBUG] 
[DEBUG] In file "/tmp/tmpdnafr6_8/workflow/Snakefile":  Formatted content is different from original
[INFO] 1 file(s) would be changed 😬

snakefmt version: 0.8.4