clami66/AF_server

None

Overview

Topics:

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

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/clami66/AF_server . --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.

config.yaml

# E-mail settings
server_address: "user@server.com" ### server mailbox address
mail_server: "server.com"  ### server mailbox domain
whitelist: "config/whitelist" ### The whitelist contains one email per line, only senders from the list will be allowed
# AF settings
AF_install_dir: "/proj/apps/alphafold" ### AlphaFold installation directory
monomer_flagfile: "/proj/apps/alphafold/flagfiles/monomer_full_dbs.flag" # monomer and multimer flag files paths
multimer_flagfile: "/proj/apps/alphafold/flagfiles/multimer_full_dbs.flag"
# resources settings, these override the slurm profile settings
mem_mb: 240000
walltime: 4320
max_gpus: 8
gpus_per_node: 8
n_cores_per_gpu: 16
# CASP settings, can be ignored if it is not a CASP server. Will show in PDB headers
CASP_groupn: "xxxx-yyyy-zzzz-wwww" # 
CASP_groupn_multi: "wwww-xxxx-yyyy-zzzz"
CASP_groupname: "af2-standard"
CASP_groupname_multi: "af2-multimer"
CASP_sender: "casp-meta@predictioncenter.org"
# for uploading results somewhere (passwordless).
# Results in invoking `rsync -av results/AF_models/{target}/[models,msas].tar.gz user@server.com:/path`
data_server_user: "user"
data_server_address: "server.com"
data_server_folder: "/path"

envmodules.yaml

envmodules:
  run_alphafold: # specifies envmodules to load when executing rule `run_alphafold`
    - Anaconda/2021.05-nsc1
    - AlphaFold/2.2.1
    - other envmodules...

whitelist

allowed_sender@mail.com # one email per line
another_allowed_sender@server.net

Linting and formatting

Linting results

Lints for snakefile /tmp/tmpzw509uh7/workflow/rules/common.smk:
    * Path composition with '+' in line 144:
      This becomes quickly unreadable. Usually, it is better to endure some
      redundancy against having a more readable workflow. Hence, just repeat
      common prefixes. If path composition is unavoidable, use pathlib or
      (python >= 3.6) string formatting with f"...".
      Also see:


Lints for rule add_headers (line 82, /tmp/tmpzw509uh7/workflow/rules/alphafold.smk):
    * 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.

... (truncated)

Formatting results

[DEBUG] 
[DEBUG] In file "/tmp/tmpzw509uh7/workflow/rules/alphafold.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] 
[DEBUG] In file "/tmp/tmpzw509uh7/workflow/rules/common.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmpzw509uh7/workflow/rules/upload.smk":  Formatted content is different from original
[DEBUG] 
[DEBUG] In file "/tmp/tmpzw509uh7/workflow/Snakefile":  Formatted content is different from original
[INFO] 4 file(s) would be changed 😬
[INFO] 1 file(s) would be left unchanged 🎉

snakefmt version: 0.8.0