DRAM Usage

DRAM2 accepts assemblies, predicted protein FASTAs, or existing DRAM annotations, depending on the selected steps. See the installation guide for software, databases, and initial HPC setup, and the Parameters API for all DRAM parameters.

Basic command

This example calls genes from assemblies, annotates against KOfam, runs QC, and produces summaries, traits, and visualizations:

nextflow run BortonWrightonLabs/DRAM -r dev \
    --input_fasta /shared/project/genomes --outdir /shared/project/dram-results \
    --rename --annotate --anno_dbs kofam --qc --summarize --traits --visualize \
    -profile apptainer -c databases.config

Set the KOfam paths in databases.config as described in installation. --anno_dbs all enables databases with existing configured paths and warns and skips missing paths; an incomplete existing database can still fail later. Explicitly name databases to keep the annotation set predictable. Annotation from --input_fasta automatically calls genes; --call is useful when requesting gene calling on its own.

Examples use -r dev for DRAM2. Replace it with a DRAM2 tag or commit for a reproducible run. For a local or shared checkout, replace BortonWrightonLabs/DRAM -r dev with /path/to/DRAM and select the revision with Git.

Custom configuration and parameters files

Nextflow options use a single dash, such as -profile, -c, -params-file, and -resume. DRAM parameters use a double dash, such as --input_fasta and --max_memory.

Setting

Nextflow config (.config)

Parameters file (.yml / .json)

Command line

Input directory

params.input_fasta = '/data/genomes'

input_fasta: /data/genomes

--input_fasta /data/genomes

Per-task memory cap

params.max_memory = '80.GB'

max_memory: '80.GB'

--max_memory '80.GB'

SLURM partition

process.queue = 'general'

Set in a config

Load config with -c

Process resource overrides

process { withLabel: ... }

Set in a config

Load config with -c

Runtime and workflow profiles

Define under profiles

Select on the command line

-profile apptainer,slurm

Loading custom configs

A custom config adds to the pipeline configuration. Save only your overrides; the pipeline’s own config and its includes are loaded automatically.

nextflow run BortonWrightonLabs/DRAM -r dev \
    -profile apptainer,slurm -c /shared/configs/cluster.config \
    -params-file run.yml

Normal Nextflow loading mechanisms all apply:

  • Save a file named nextflow.config in the launch directory for automatic loading. This is the directory where you issue the command, which may differ from the pipeline checkout.

  • Use -c /path/to/custom.config to add an explicitly named file, or -c cluster.config,databases.config,resources.config to combine files. Later files override earlier assignments to the same setting, subject to process-selector priority.

  • Use includeConfig '/shared/configs/cluster.config' in another config. Relative include paths are resolved relative to the file containing the include.

  • Use $NXF_HOME/config (normally $HOME/.nextflow/config) for user-wide defaults affecting all pipelines.

For assignments to the same config setting, precedence increases from user-wide config, to project config, to launch-directory config, to files passed with -c. Use lowercase -c for routine overrides. Uppercase -C ignores the normal config files, including DRAM’s defaults and includes, so it is unsuitable for a small override file. See the Nextflow configuration guide.

YAML and JSON parameters files

Save DRAM parameters as a top-level mapping without params, -- prefixes, or Nextflow options. For example, run.yml:

input_fasta: /shared/project/genomes
outdir: /shared/project/dram-results
rename: true
annotate: true
anno_dbs: kofam
qc: true
summarize: true
traits: true
visualize: true
max_cpus: 12
max_memory: '80.GB'
max_time: '24.h'

The equivalent JSON file, run.json, is:

{
  "input_fasta": "/shared/project/genomes",
  "outdir": "/shared/project/dram-results",
  "rename": true,
  "annotate": true,
  "anno_dbs": "kofam",
  "qc": true,
  "summarize": true,
  "traits": true,
  "visualize": true,
  "max_cpus": 12,
  "max_memory": "80.GB",
  "max_time": "24.h"
}

Load either file with -params-file run.yml or -params-file run.json. YAML/JSON files contain literal values: Groovy expressions such as 80.GB and ${launchDir} are not evaluated there. Use quoted unit strings such as '80.GB' and absolute paths for files shared between projects. Relative input/output paths are interpreted from the launch directory, not from the parameters file’s location. Comma-separated DRAM options such as anno_dbs should remain strings, for example anno_dbs: 'kofam,camper'.

DRAM parameter precedence is config defaults/overrides, then -params-file, then explicit --parameter value arguments. For example, this uses the settings in run.yml but writes to a different output directory:

nextflow run BortonWrightonLabs/DRAM -r dev \
    -profile apptainer,slurm -c cluster.config,databases.config \
    -params-file run.yml --outdir /shared/project/second-results

Keep -profile, -c, -params-file, -work-dir, and -resume on the command line. Parameters files are not loaded automatically. See the Nextflow CLI guide for parameter-file behavior.

Launching directly or in the background

The Nextflow driver must remain running while it submits and monitors tasks. Follow your cluster’s policy: run it in a persistent terminal such as tmux, on an approved workflow host, or inside a SLURM driver job. A driver job must stay alive for the entire analysis and must be able to submit further jobs. Its resource allocation is separate from the CPU, memory, and time requested for DRAM tasks; size it for the workflow and your site’s guidance rather than assuming a fixed 1 GB is sufficient.

-bg runs the Nextflow driver in the background and records output in the Nextflow log. It does not submit the driver to SLURM or bypass login-node policies and session cleanup. When running the driver inside a batch script, keep Nextflow in the foreground so the driver job waits for it to finish.

Important Command-Line Options Explained

--input_fasta

Directory containing assembly FASTAs. Choose which files are read with --fasta_fmt, quoting wildcard patterns on the command line. See Parameters API for more information.

--outdir

This is the desired output directory.

--input_genes

Directory containing predicted protein FASTAs. Gene identifiers must be unique across samples for downstream processing; use --rename if needed. Change the filename pattern with --genes_fmt. Supply matching nucleotide gene FASTAs when required by selected annotation tools; see genes_fna_fmt in the Parameters API. See Parameters API for more information.

--annotations

If the user already has a DRAM2 annotations TSV file, in the correct format, they can provide these using this command-line option.

Running on SLURM

Use -profile apptainer,slurm or -profile singularity,slurm and a site config defining the partition, account/QoS, and submission limits. The built-in slurm profile selects only the executor. Without it or an equivalent process.executor = 'slurm' setting, tasks use the local executor. A SLURM allocation for the driver alone does not configure task submission.

See SLURM setup for a minimal cluster.config and shared-storage requirements. Use process.queue for the partition and process.clusterOptions for extra options such as account, QoS, node constraints, or GPU allocation. Set CPUs, memory, and time with Nextflow directives, rather than duplicating them with --cpus-per-task, --mem, or --time in clusterOptions. For clusters requiring memory per CPU, Nextflow supports executor.perCpuMemAllocation = true. See the Nextflow SLURM reference.

The CPU example and CPU/GPU example use placeholder partition, account, and QoS values. Save copies alongside your run files and replace those values for your allocation. Both set the executor directly and can be loaded by -c, includeConfig, or as a launch-directory nextflow.config; their filenames have no special meaning to Nextflow.

CPU tasks using Singularity and separately configured database paths:

nextflow run BortonWrightonLabs/DRAM -r dev \
    -profile singularity -c slurm_cpu.config,databases.config \
    -params-file run.yml -work-dir /shared/project/dram-work

CPU and GPU tasks using Apptainer:

nextflow run BortonWrightonLabs/DRAM -r dev \
    -profile apptainer,gpu -c slurm_gpu.config,databases.config \
    -params-file run.yml -work-dir /shared/project/dram-work

The CPU/GPU example routes process_gpu tasks to gpu_partition with a single-GPU request; ordinary tasks use cpu_partition. Replace both partition names, account and QoS placeholders, and GPU allocation syntax with settings accepted by your cluster. The built-in gpu profile selects GPU MMseqs searches and exposes GPUs to containers. Requesting a GPU in SLURM alone does not select the GPU search implementation. GPU runs also require suitable NVIDIA nodes/drivers and GPU-formatted database paths such as kegg_gpu_db; a CPU-formatted MMseqs database is not interchangeable. --mmseqs_gpu_exclude_dbs keeps selected databases on the CPU route. Large GPU database indexes may require increasing both the process memory request and max_memory beyond the template’s example cap.

Configure database paths in databases.config and choose a runtime with -profile. Set partitions with process.queue, submission limits with executor.queueSize, and account/QoS/GPU flags with clusterOptions. A selector’s clusterOptions value replaces the inherited string, so repeat any required account flag in both CPU and GPU settings.

executor.queueSize limits the executor’s submitted task queue; executor.submitRateLimit throttles submissions. A process-specific maxForks limits concurrent tasks for that process. These settings are distinct from per-task resource caps, batching, and arrays.

Resource caps and job arrays

DRAM chooses first-attempt CPU, memory, and time requests from the resource labels in conf/base.config, subject to resource caps and overrides. CALL_GENES, TRNA_SCAN, RRNA_SCAN, HMM_SEARCH, MMSEQS_SEARCH, and QUAST vary their requests according to input size. Mixed runs are separated into small, medium, and large task classes by --resource_class_small_max_size and --resource_class_medium_max_size.

--resource_class_small_max_size and --resource_class_medium_max_size set the inclusive upper limits of the small and medium classes. Larger inputs use the large class. Both limits must be positive, and the medium limit must exceed the small limit. Nextflow size units are binary: 200.MB means 200 MiB.

Class thresholds control which resource requests an input receives. The independent *_batch_size and *_batch_max_size parameters control how many inputs share a task and which inputs may join a batch. To change CPU, memory, or time requests within a class, override the resource labels from conf/base.config in your custom config.

Workload size is stored as per-sample channel metadata rather than re-read by every downstream database. DRAM measures the final decompressed/renamed input FASTA once for CALL_GENES, TRNA_SCAN, and RRNA_SCAN. After gene calling, it separately measures the called protein FASTA for every HMM/MMseqs search and the filtered FASTA for consumers such as QUAST and antiSMASH. Files, collections, and directory contents within one input are summed recursively. Auxiliary description files and metadata tables are not included. HMM and MMseqs searches are also sized by their database; see Search resources.

Each class’s requests are in conf/base.config, under the labels listed in Overriding labels and process resources.

Search resources

HMM_SEARCH and MMSEQS_SEARCH requests come from both the input’s class and the database. A database is small when what the search holds is under 4 GiB: an MMseqs database’s .idx index when it has one, otherwise the whole database. Small databases (MEROPS, CAMPER, CANT-HYD, CARD, TCDB, viral, and the small HMM sets) search in seconds; KOfam, VOG, Pfam, KEGG, and UniRef are big.

The requests are set by process_hmm_search and process_mmseqs_search in conf/base.config. Small databases get few CPUs and a shorter time limit; big databases scale CPUs with the input class. HMM memory follows the input, because profiles are streamed. MMseqs memory follows the index (or database) size, plus an allowance per CPU and headroom. Time is a fixed base plus a per-input rate times search_batch_size.

MMseqs2 maps its whole index into memory, so the request follows the index: KEGG asks for about 206 GiB and UniRef about 411 GiB, so --max_memory has to be above that. MMseqs2 judges memory from the machine, not the job’s limit, and with too little memory it stalls until the time limit instead of failing. So before searching, each MMseqs task checks its memory against the index and stops with an error naming the size if it is too small. Raise --max_memory above the index size, or point the database parameter at a copy of the database without its .idx* files: without an index, DRAM passes --split-memory-limit and MMseqs2 splits the search to fit, which is slower but needs far less memory (KEGG ran in 40 GB).

On a retry, search tasks grow only what ran out: memory doubles after exit code 137 (killed, usually out of memory), and time doubles after 140 or 143 (time limit). CPUs stay the same.

With --job_array_size, Nextflow evaluates an array job’s own request without task inputs, so search arrays ask for the --max_cpus, --max_memory, and --max_time caps. Each task inside the array still sizes itself.

--max_cpus, --max_memory and --max_time cap a single task’s request. These are upper limits only; raising them does not increase a process request. A cluster configuration can override label resources when larger or smaller defaults are required.

Set --job_array_size to enable job arrays for bucketed CALL_GENES, TRNA_SCAN, RRNA_SCAN, HMM_SEARCH, and MMSEQS_SEARCH tasks on an executor that supports arrays. Values 0 and 1 disable arrays; values of 2 or greater specify the maximum number of tasks per array. Do not enable this parameter with an unsupported executor. Gene calling, tRNA scanning, and rRNA scanning remain separate process families, so each can fail, retry, and receive site-specific overrides independently.

Overriding labels and process resources

Resource labels group tasks under the policies in conf/base.config. Override their directives in a custom config rather than editing the pipeline or renaming labels. The input-sensitive labels are:

Label

Processes affected

process_call_genes

Prodigal gene calling

process_trna_scan

tRNAscan-SE

process_rrna_scan

Barrnap

process_quast

QUAST

process_hmm_search

All HMM searches

process_mmseqs_search

CPU and GPU MMseqs searches

process_gpu

GPU tasks; also configures GPU/container access

process_array

Tasks eligible for job_array_size

Generic labels (process_tiny, process_single, process_small, process_medium, process_big, process_huge) give other processes fixed first-attempt requests, set in conf/base.config.

The semantic search labels apply to searches in every size class. Overriding process_medium does not change a search’s medium class; override process_hmm_search or process_mmseqs_search instead.

For example, save this as resources.config to set fixed requests for all MMseqs searches and larger requests for the large KEGG CPU search class:

params {
    max_cpus = 32
    max_memory = '256.GB'
    max_time = '72.h'
}

process {
    withLabel: 'process_mmseqs_search' {
        cpus = 8
        memory = '64.GB'
        time = '12.h'
    }

    withName: '.*:MMSEQS_KEGG:SEARCH_LARGE' {
        cpus = 32
        memory = '256.GB'
        time = '48.h'
        queue = 'large_memory'
    }
}

Load it after your site settings with -c cluster.config,databases.config,resources.config. Check that your parameters file or explicit --max_* arguments do not lower these caps. max_memory, max_cpus, and max_time cap each task; they do not limit total workflow usage. --threads is not a replacement for process CPU directives.

To retain size-based CPU/memory requests while changing only search wall time, use a dynamic directive:

process {
    withLabel: 'process_mmseqs_search' {
        time = { (1.h + (resource_class == 'small' ? 2.h : resource_class == 'medium' ? 4.h : 48.h) * params.search_batch_size) * task.attempt }
        // In a job array's own request task inputs are absent; read them with delegate.get('target') if you use them.
    }
}

Fixed overrides replace the default expressions, including their retry scaling and batching multipliers. The dynamic example preserves both for wall time. Most defaults scale resources with task.attempt on retries, subject to the same caps; the search labels instead grow only the resource that ran out (Search resources). Retries occur only when the error strategy allows them. Set requests to values supported by the chosen partition.

For selector priority, withName overrides withLabel, which overrides unselected process defaults. An included process alias takes priority over its original name, and a fully qualified selector takes priority over either. A plain process.memory override therefore may not affect labeled DRAM tasks. See Nextflow process selectors.

Searches run inside a workflow per database. Useful selectors include:

Selector

Scope

withName: MMSEQS_SEARCH

All CPU MMseqs searches

withName: MMSEQS_SEARCH_GPU

All GPU MMseqs searches

withName: HMM_SEARCH

All HMM searches

withName: '.*:MMSEQS_KEGG:SEARCH_.*'

All KEGG CPU size classes

withName: '.*:HMM_KOFAM:SEARCH_LARGE'

Large KOfam HMM tasks

withName: '.*:MMSEQS_GPU_KEGG:SEARCH_GPU_.*'

All KEGG GPU size classes

Replace old MMSEQS_SEARCH_KEGG_.* / HMM_SEARCH_KOFAM_.* selectors with these workflow-qualified patterns. Use the task names in .nextflow.log or the execution trace to identify the database workflow and process alias. Keep initial scheduler directives uniform within each array-capable process when using job arrays.

Inspect merged config before launching, using your local checkout or the cached pipeline directory containing the revision you pulled:

nextflow -c cluster.config,databases.config,resources.config config /path/to/DRAM \
    -profile apptainer,slurm -flat

This checks config loading but does not validate every selector against running tasks or apply a run’s -params-file. Check actual CPU/memory/time requests in the execution trace and the task’s work/.../.command.run submission script after a small run.

Gene-calling and RNA batching

--call_batch_size runs Prodigal sequentially for up to that many input FASTAs in one CALL_GENES task. --rna_batch_size similarly groups FASTAs per task, but tRNAscan-SE and Barrnap still run in separate tasks. Set either to 1 for one task per input, which streams inputs as they become ready.

--call_batch_max_size and --rna_batch_max_size set the largest individual FASTA allowed to join the corresponding batch. An input above its limit runs alone. Inputs at or below the limit may be grouped up to the configured batch size even when their combined size exceeds the limit. A batch’s resource class is the class of its largest member.

When either batch size is greater than one, that stage waits for all its inputs and sorts them by sample name to produce deterministic batches. Wall time is a fixed base plus a per-input rate times the configured batch size (see conf/base.config), then limited by max_time; CPU and memory are not multiplied. Outputs are restored to the existing per-sample channels and filenames.

Search batching

--search_batch_size puts up to that many inputs against one database in a single task. 1 runs one task per input per database and streams inputs as they become ready. HMM searches run one after another inside the task. MMseqs searches run once for the whole batch: the inputs’ proteins form one query database, so the target database is loaded once, and hits are split back to each input. MMseqs E-values depend only on the target database, so each input gets the same hits it would alone. Every input keeps its own gene locations and output filenames.

--search_batch_max_size is the largest individual query input allowed to join a batch. Inputs at or below the limit can be grouped up to search_batch_size, regardless of their combined size. An input above the limit runs alone. Database size is never considered. These options affect HMM and MMseqs searches only.

When batching is enabled, each database workflow waits for its input channel to finish and sorts by sample name before packing. This makes batch membership independent of task completion order, at the cost of delaying searches until all queries are ready. A batch’s resource class comes from its largest individual protein query, whose size was measured once before database fan-out. The combined size of the batch, database size, and generated MMseqs index size do not affect its class; the database sets the rest of the request (see Search resources).

CPU and memory follow Search resources. Search wall time grows with the configured search_batch_size (one fixed hour plus a per-input rate), then is capped by max_time. Even partial batches use that same multiplier so every array-capable process has uniform initial requests. Choose a smaller batch size or override the search resource labels if the resulting time cap is insufficient. Site overrides must also keep initial scheduler directives uniform within each array-capable process.

Batching and arrays can be used independently or together:

nextflow run BortonWrightonLabs/DRAM -r dev \
    -profile apptainer,slurm -c cluster.config \
    --search_batch_size 10 --search_batch_max_size '1.GB' \
    --job_array_size 100 [OPTIONS]

Here each array contains up to 100 tasks, and each task searches up to ten inputs. Arrays still contain independently scheduled tasks; batching reduces the number of tasks themselves.

For every batching option, Nextflow caches and retries an entire batch task. A failed member fails the task, and retrying it repeats the other members too; retries occur only when the configured error strategy permits them. Changing the input set or batching parameters can change membership and reduce cache reuse. Per-sample output channels and published filenames are preserved. Larger batches cut per-task scheduler overhead but run fewer tasks in parallel, which slows small runs.

Optional MMseqs2 sensitivity rounds

--mmseqs_sensitivity_rounds_dbs kegg searches the listed MMseqs databases in rising sensitivity rounds (--start-sens 1 --sens-steps 3 -s 5.7). MMseqs2 first searches every gene at low sensitivity, then sends only the genes still without a hit to the next, more sensitive round, ending at the default -s 5.7. It’s opt-in.

This is the approach the MMseqs2 user guide recommends under “How to find the best hit the fastest way”. The guide says it can speed up best-hit searches 4–10 times. It also says there’s a small chance the best hit is missed, because hits found at low sensitivity share more highly conserved k-mers, and that a higher start sensitivity (--start-sens 4) reduces this effect. To try that, set ext.sensitivity_rounds_args (below).

The trade-off, measured on KEGG with 15 genomes (53,980 genes, one merged search):

  • About 7–8× less CPU time (48,192 s → about 6,200 s) and about 6× less wall time.

  • About 32 of 52,660 annotated genes (0.06%) change. 23 genes lost their hit, none of which had a KO; most were close to the 60-bit cutoff. Of the 9 genes whose KO changed, 3 lost their KO, 4 gained a KO from a weaker hit, and 2 swapped to a closely related KO.

  • Rounds can only make a best hit weaker, never stronger: a gene that finds a passing hit in an early round never reaches the later rounds, where a better hit might be.

Rounds pay off on large databases such as KEGG and UniRef. On small databases they save little and can still swap in weaker hits. They apply to CPU searches only: a listed database that runs on GPU, Pfam (a profile search), or a database not in --anno_dbs is skipped with a warning. An unknown name stops the run.

The flags come from ext.sensitivity_rounds_args on MMSEQS_SEARCH in conf/modules.config. To try other rounds, override it in your own config; the closure can read db_name, so the change can apply to one database (note that CANT-HYD’s db_name is cant_hyd). The measured trade-off above applies only to the default flags.

process {
    withName: MMSEQS_SEARCH {
        // KEGG starts at the higher sensitivity the MMseqs2 user guide suggests; the rest keep the default
        ext.sensitivity_rounds_args = { db_name == 'kegg' ? '--start-sens 4 --sens-steps 2 -s 5.7' : '--start-sens 1 --sens-steps 3 -s 5.7' }
    }
}

ext.args on MMSEQS_SEARCH adds any other options to the mmseqs search step for non-Pfam databases, whether or not rounds are on. MMseqs2 rejects a flag given twice (Duplicate parameter), so change the rounds through ext.sensitivity_rounds_args, not by repeating -s in ext.args.

Optional stricter HMMER filters

--hmm_strict_filters_dbs kofam searches the listed HMM databases with stricter HMMER filter thresholds (--F1 0.002 --F2 1e-4). It’s opt-in.

HMMER passes each gene–profile pair through three filters before the full score (MSV, Viterbi, Forward), with P-value thresholds F1, F2 and F3 (defaults 0.02, 1e-3, 1e-5). Stricter thresholds send fewer pairs on to the slower stages. The filter scores are estimates, so now and then a real hit scores low early and is dropped.

The trade-off, measured on KOfam with 3 genomes (4,845 genes with a KO), 6 threads:

Filters

CPU time saved

KOs lost

KOs gained

KOs changed

--F1 0.005

10%

4

0

1

--F1 0.002 --F2 1e-4 (the default for this option)

20%

6

0

1

--F1 0.001 --F2 1e-5 --F3 1e-6

26%

7

0

1

KOfam is where this pays off: it takes most of the HMM search time. The other HMM databases (VOG, FeGenie, metals, sulfur, CAMPER, CANT-HYD, DRAM_DB) take much less, and the trade-off wasn’t measured on them. Metals keeps weaker hits (--metals_e_value 1e-3), which stricter filters are more likely to drop. dbCAN runs its own search and isn’t affected. A listed database not in --anno_dbs is skipped with a warning. An unknown name stops the run.

The thresholds come from ext.strict_filters_args on HMM_SEARCH in conf/modules.config. To try others, override it in your own config; the closure can read db_label, the search’s column prefix (note that CANT-HYD’s is cant_hyd_hmm, CAMPER’s camper_hmm and VOG’s vogdb). The measured trade-off above applies only to the default thresholds.

process {
    withName: HMM_SEARCH {
        // KOfam uses the strictest measured filters; the rest keep the default
        ext.strict_filters_args = { db_label == 'kofam' ? '--F1 0.001 --F2 1e-5 --F3 1e-6' : '--F1 0.002 --F2 1e-4' }
    }
}

Important Core Nextflow Options

Nextflow provides many command-line options to control how the pipeline is run. Below are some of the most important ones for DRAM2 users. You will also notice that all Nextflow options can be seen by running:

nextflow run -help

It is also worth noting that all Nextflow options are specified with a single dash -, while all DRAM2-specific options are specified with a double dash --.

-bg

Run the Nextflow driver in the background. Use it only where cluster policy permits persistent background processes; see launching directly or in the background.

-profile

This is the Nextflow profile to use. The profile determines how software dependencies are handled and what compute environment settings are used. Common profiles include singularity, apptainer, docker, conda, and slurm. Profiles can be composed as a comma-separated list.

The full_mode profile enables annotate, QC, refine (summarize, traits, visualize), and anno_dbs = 'all'. It does not enable rename. Runtime and executor profiles can be combined with it; choose one runtime. See nextflow.config for all built-in profiles. With the default config parser, profiles are applied in their definition order, not their order in the comma-separated list.

-resume

Reuse successfully completed tasks whose inputs, scripts, and relevant settings still match. Preserve both the launch directory’s .nextflow/cache and the work directory selected with -work-dir (default work/). Resume from the same launch directory, using the same work directory and pipeline revision where possible. -resume resumes the latest run; -resume <run_name_or_session_id> selects a specific run. Changed inputs or settings can cause tasks to rerun; output files alone are insufficient to resume.

-with-trace

Write task execution details. DRAM already enables trace, report, timeline, and DAG outputs under <outdir>/pipeline_info/. Use .nextflow.log in the launch directory for driver and submission errors, and task .command.err, .command.out, and .command.run files in the work directory for task failures.

Pipeline steps

--rename

Prefix assembly or protein FASTA headers with the sample filename to make identifiers unique across samples. This is optional. A FASTA whose headers all already start with <filename>_ is passed through unchanged instead of being prefixed twice; one where only some do is renamed in full, with a warning in the task’s .command.err.

--call

Call genes with Prodigal without requiring annotation. Gene calling is also enabled automatically when --annotate is combined with --input_fasta.

--annotate

Annotate called genes. You will need to specify what databases to annotate against with --anno_dbs [OPTIONS] or --use_[DB]. See the Parameters API documentation for more details, or --help.

--qc

Run quality control options for the DRAM workflow. With --input_fasta, QC scans for rRNA and tRNA using Barrnap and tRNAscan-SE. Without raw FASTA, QC can collect precomputed --rrnas and --trnas tables. It can also add --bin_quality and --taxa data to annotations produced by --annotate or supplied with --annotations. QC outputs remain under the ANNOTATE output directory.

--summarize, --visualize, --traits, --refine

The Refinements, run together as one dram-rules command on the annotations from this run or from --annotations. Each has its own flag; --refine runs all three.

  • --summarize counts, per genome, the genes matching each rule of the Summarize Sheets and writes SUMMARIZE/{topic,ecosystem,custom,custom_derived}_summary.{xlsx,tsv}. Ecosystem summaries are built each run from the ecosystem visualize sheets: one row per Gene ID their rules look up, with the rule, module and group using it. --viz_custom sheets get one in custom_derived_summary.

  • --visualize writes heatmaps and tables of each rule’s Presence or Coverage to VISUALIZE/<sheet>/.

  • --traits does the same for the built-in traits sheet, in TRAITS/.

Sheets: --ecos picks built-in ecosystem sheets (ag, aquatic, bgc, eng_sys, gut, or none) for both visualize and summarize. --topics picks topic Summarize Sheets (assim, cell, energy, env, default for all four, or none). --sum_custom, --viz_custom and --traits_custom add your own sheets, comma separated. Each Summary Collection workbook has one worksheet per sheet, named after the --topics or --ecos name, or the custom file’s name without its extension, so with --summarize those --sum_custom and --viz_custom names must be valid Excel worksheet names, unique regardless of case, or Refine stops with a usage error before running; the .tsv names the worksheet in a sheet column. --descriptions adds Description Tables (gene_id, description) for the Gene IDs in those derived summaries. --mapping adds per-sample abundances to visualize and traits; with --annotate they are also added to raw-annotations.tsv as sample:<name> columns (Sample Columns), after every other column, which dram-rules reads in place of a mapping file. tRNAs from --qc count as genes in every Refinement.

--sum_ecos, --sum_topics, --viz_rules_system, --viz_rules_tsv, --viz_mapping_file, --trait_rules_tsv, --product, --adjectives and --distill_* still work but are deprecated.

Other Command-Line Options Notes

Other command-line options exist to control specific parameters of the DRAM2 pipeline. These are all described in the Parameters API documentation page, or can be seen by running:

nextflow run BortonWrightonLabs/DRAM -r dev --help


DRAM2 example commands

Annotate pre-called proteins with KOfam:

nextflow run BortonWrightonLabs/DRAM -r dev \
    --input_genes /shared/project/proteins --outdir /shared/project/protein-results \
    --rename --annotate --anno_dbs kofam \
    -profile apptainer -c databases.config

Summarize existing DRAM annotations without rerunning annotation:

nextflow run BortonWrightonLabs/DRAM -r dev \
    --annotations /shared/project/annotations.tsv --outdir /shared/project/summary-results \
    --refine --ecos 'eng_sys,ag' \
    -profile apptainer

Run all databases found at their configured paths on SLURM, including traits, and reuse eligible completed tasks:

nextflow run BortonWrightonLabs/DRAM -r dev \
    --input_fasta /shared/project/genomes --outdir /shared/project/dram-results \
    --rename --annotate --anno_dbs all --qc --refine \
    --ecos 'eng_sys,ag' \
    -profile apptainer,slurm -c cluster.config,databases.config \
    -work-dir /shared/project/dram-work -resume

The same steps through full_mode:

nextflow run BortonWrightonLabs/DRAM -r dev \
    --input_fasta /shared/project/genomes --outdir /shared/project/dram-results \
    --rename --ecos 'eng_sys,ag' \
    -profile apptainer,slurm,full_mode -c cluster.config,databases.config \
    -work-dir /shared/project/dram-work -resume

Reuse saved run parameters and override resources:

nextflow run BortonWrightonLabs/DRAM -r dev \
    -profile apptainer,slurm \
    -c cluster.config,databases.config,resources.config -params-file run.yml \
    -work-dir /shared/project/dram-work -resume