sneuensc/mapache

mapping pipeline for ancient DNA

Overview

Topics: adna ancient-dna genomics mapping mapper pipeline workflow snakemake fastq bam

Latest release: v0.3.0, Last update: 2024-10-28

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/sneuensc/mapache . --tag v0.3.0

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.

General settings

To configure this workflow, modify config/config.yaml according to your needs.

To run mapache at least the following two parameters have to be set in the file config/config.yaml:

  • a reference genome (e.g., hg19 human reference genome):
genome: 
  hg19:                                  ## prefix for the reference genome (free to choose)
    fasta: path_to_reference/foo.fasta   ## file location
  • the path to the sample file samples.tsv:
sample_file: config/samples.tsv

The sample file samples.tsv lists all fastq files and their relationship to library and sample in a tab seperated format. For single-end libraries the format is:

SM LB Data ID
ind1 lib1_lb lib1_R1_001.fastq.gz lib1_R1_001_fq
ind1 lib1_lb lib1_R1_002.fastq.gz lib1_R1_002_fq
ind1 lib2_lb lib2_R1_001.fastq.gz lib2_R1_001_fq
ind1 lib2_lb lib2_R1_002.fastq.gz lib2_R1_002_fq
ind2 lib3_lb lib3_R1_001.fastq.gz lib3_R1_001_fq
ind2 lib3_lb lib3_R1_002.fastq.gz lib3_R1_002_fq

where

  • SM: sample name
  • LB: library name
  • ID: uniq identifier for the fastq file (row)
  • Data: path to the fastq file

For more details, please read the Wiki. The code is available on GitHub.

Run mapache

After configuering the files config/config.yaml and the samples.tsv you can run mapache using the command

snakemake -j1

Linting and formatting

Linting results

/tmp/tmpsjfdl1ld/sneuensc-mapache-54c773d/workflow/scripts/utils.py:357: SyntaxWarning: invalid escape sequence '\s'
  delim = get_param(["delim"], "\s+")
/tmp/tmpsjfdl1ld/sneuensc-mapache-54c773d/workflow/scripts/utils.py:467: SyntaxWarning: invalid escape sequence '\s'
  delim = get_param(["delim"], "\s+")
ERROR: Reference genome config[hg19] does not exist (/work/FAC/FBM/DBC/amalaspi/popgen/shared_resources/reference_human/hs.build37.1/hs.build37.1.fa)!
grep: /work/FAC/FBM/DBC/amalaspi/popgen/shared_resources/reference_human/hs.build37.1/hs.build37.1.fa: No such file or directory
ERROR: Fastq file '/work/FAC/FBM/DBC/amalaspi/popgen/cegamorim/Andes/DATA/fastq_LINDO_POPOVIC/ERR4880182_1.fastq.gz' does not exist!

Formatting results

[DEBUG] 
<unknown>:1: SyntaxWarning: invalid escape sequence '\*'
[DEBUG] 
[DEBUG] In file "/tmp/tmpsjfdl1ld/sneuensc-mapache-54c773d/workflow/Snakefile":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmpsjfdl1ld/sneuensc-mapache-54c773d/workflow/rules/fastq.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] 
[DEBUG] 
[DEBUG] 
[DEBUG] In file "/tmp/tmpsjfdl1ld/sneuensc-mapache-54c773d/workflow/rules/stats.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmpsjfdl1ld/sneuensc-mapache-54c773d/workflow/rules/imputation_glimpse.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmpsjfdl1ld/sneuensc-mapache-54c773d/workflow/rules/common.smk":  Formatted content is different from original
[INFO] 5 file(s) would be changed 😬
[INFO] 4 file(s) would be left unchanged 🎉

snakefmt version: 0.10.2