Skip to content

v1.0 Wiki Archive

Tessa Alexanian edited this page Jul 24, 2026 · 1 revision

📦 Archived documentation for commec v1.0. These pages describe commec v1.0 and are preserved here for reference. For the current release, see Home, Install, Tutorial, and Command Line Usage.

A faithful per-page snapshot is also tagged in the wiki repository as wiki-v1.0.

Contents (v1.0)

  1. Transitioning from v0 to v1.0
  2. Install Guide
  3. Tutorial
  4. Command Line Usage
  5. Extending With Your Own Databases

Transitioning from commec v0 to v1

This page will guide you through the transition to version 1.0 of commec. It also contains the command-line reference for version 0.3.

Transitioning to version 1.0

If you have been using commec already, you may be excited to see the new features offered in the 1.0 release! Here you will find some quick-start information to help orient those who are already familiar with using previous versions of commec.

New output formats:

commec now outputs a .output.json, an .html file, and a .log, instead of just a .screen text file.

  • .output.json is a JSON format text file, which contains the core output data of commec screen, in a human readable, albeit dense, format. It is also handy to pass off to any other custom scripts you may use.
  • .screen.log is the formatted log, also printed to console, typcially useful for in depth debugging (with --verbose) or just checking on the final output in a short-form table. This output is the most similar to the previous .screen file, however is more organised at a per-query level.
  • _summary.html Provides a graphical output, highlighting which regions of your input queries were flagged, and/or subsequently cleared.

New Input formats:

As well as familarising yourself with commecs output formats, it is also important to consider potential changes to the input databases setup, as well as input query .fasta files.

  • .fasta files support multiple queries in a single file. Each query will be treated independantly throughout the commec screen pipeline.
  • The standard commec database folder layout has changed, and the download location of the latest commec biorisk and low-concern databases has switched to github. The databases are easily downloaded to a desired location using the commec setup command.
  • The standard input .yaml config file setup has change, invalid keys will result in warnings in commec screen, but it is recommend you regenerate any .yaml config files you use to match the keys in the defaults example.
  • The default nucleotide database for commec is now nt_core. This database is smaller, and faster than nt, whilst still retaining the sensitivity requirements for commec screen.

Altered wordings

To better facilitate understanding, several terms in commec have changed. The Benign Step, has been renamed to the Low-concern Step. Similarly the benign databases are databases of Low-concern.

--fast-mode has been rebranded as --skip-tx, to better reflect that this is infact a truncated version of the commecs screen pipeline, which skips taxonomy searches.

commec flag

the commec flag command now parses the new .output.json files, instead of the previous .screen log files, and forms a single .csv. If you need to run flag on .screen and .json files, there is a helper script: dev_scripts/flag-legacy.py, which can do this for you.

v0 Command Line Usage

You will find the full v1.0 Command Line Usage reference below in this archive.

screen arguments

The arguments for flag, setup, and split were unchanged from v0 to v1.

Argument Type Description
fasta_file Required FASTA file to screen. Should only contain a single query
-d DATABASE_DIR, --databases DATABASE_DIR Required (unless -y specified) Path to directory containing reference databases (e.g. taxonomy, protein, HMM)
-y CONFIG_YAML, --config CONFIG_YAML Required (unless -d specified) Configuration for screen run in YAML format, including custom database paths
Screen run logic options
-f, --fast Optional flag Run in fast mode and skip taxonomy homology search
-p {blastx,diamond}, --protein-search-tool {blastx,diamond} Optional Tool for protein homology search to identify regulated pathogens (default: blastx)
-n, --skip-nt Optional flag Skip nucleotide search (regulated pathogens will only be identified based on protein hits)
Parallelisation options
-t THREADS, --threads THREADS Optional Maximum number of CPU threads to use. Passed to search tools. (default: 1)
-j DIAMOND_JOBS, --diamond-jobs DIAMOND_JOBS Optional, diamond-only Number of runs to do in parallel on split Diamond database (to increase speed, DIAMOND databases have been split into several parts)
Output options
-v, --verbose Optional flag Output verbose (i.e. DEBUG-level) logs
-o OUTPUT_PREFIX, --output OUTPUT_PREFIX Optional Prefix for output files. Can be a string (interpreted as output basename) or a directory (files will be output there, names determined from input FASTA). Defaults to location of input FASTA.
-c, --cleanup Optional flag Delete intermediate output files for run
-F, --force Optional flag Overwrite any pre-existing output for run (cannot be used with --resume)
-R, --resume Optional flag Re-use any pre-existing output run (cannot be used with --force)

Install Guide (v1.0)

This guide will walk you through the process of installing commec and its dependencies.

Quick Start

For most users, this is the fastest way to get started:

# Set up conda channels
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict

# Create and activate new environment
conda create -n commec-env commec
conda activate commec-env

# Download core databases using commec setup (~2GB)
commec setup

You should then create a config YAML file pointing to your databases. We recommend running with 4 threads:

cat <<EOF > config.yaml
base_paths:
  default: /PATH/TO/YOUR/DATABASES/DIR/
threads: 4
EOF

Within your conda environment, you can now run screen with --skip-tx on an input FASTA of your choice with:

commec screen --skip-tx input.fasta -y config.yaml

System Requirements

  • Operating system: commec has only been extensively tested on Linux systems; it can also be run through a Docker biocontainer
  • Software: Python >=3.10 and Conda (we recommend either Miniconda or Miniforge)
  • Disk space: depends on use case. Note that additional space will be required to store the output of runs.
    • using –-skip-tx: 2 GB custom databases
    • full search: ~275 - 650 GB, depending on protein/nt databases used
  • RAM: while most jobs run with 20GB RAM or less, unless running in --skip-tx mode it is best to allow 100GB for RAM-intensive queries.
  • CPU: at least 4 threads recommended to improve protein homology search speed.

Installing the commec package

The commec package has both Python and command-line dependencies, as the pipeline makes use of bioinformatics tools such as BLAST and hmmer.

As such, we recommend creating a conda environment and installing the package into it. You will need to install conda, then make sure your channels, including bioconda and conda-forge, are configured correctly.

Install from Bioconda (recommended)

We recommend installing commec as a bioconda package. First, follow the bioconda setup instructions. Then run:

# Configure channels
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict

# Create and activate new environment
conda create -n commec-env commec
conda activate commec-env

# Verify installation
commec --help

To update the bioconda install, run:

conda activate commec-env
conda update commec

Install using Docker Biocontainer

If using a Windows system, you will need to run commec through a Docker biocontainer. First, you will need to ensure docker is set up on your system.

Then, in the command prompt (via terminal or Docker Desktop) run:

docker pull quay.io/biocontainers/commec:0.3.2--pyhdfd78af_1
docker run quay.io/biocontainers/commec:0.3.2--pyhdfd78af_1 commec -help

To run commec with Docker, you will need to set up your databases and then mount them. So, for example, if you’ve downloaded the databases for –-skip-tx and placed them and the FASTA you wanted to screen in the folder “Documents\Commec”, you will run:

docker run -it -v "Documents\Commec:/mnt/files" quay.io/biocontainers/commec:0.3.2--pyhdfd78af_1

You can have databases (and FASTA files) in multiple locations, you’ll just need to mount the locations separately:

docker run -it -v "your\path\to\folder:/mnt/files" -v "your\other\path\to\folder:/mnt/files2" quay.io/biocontainers/commec:0.3.2--pyhdfd78af_1

Within the container (if using Docker Desktop), you should then be able to write a command like:

commec screen -d /mnt/files/databases/ /mnt/files/sequence.fasta --skip-tx

You can also concatenate these commands if running from a command line:

docker run -it -v "Documents\Commec:/mnt/files" quay.io/biocontainers/commec:0.3.2--pyhdfd78af_1 commec screen -d /mnt/files/databases/ /mnt/files/sequence.fasta --skip-tx

You can also write a dockerfile to directly pull the databases needed from (thanks to mcrone for the suggestion):

FROM quay.io/biocontainers/commec:0.3.2--pyhdfd78af_1

RUN wget -O commec-dbs.zip https://f005.backblazeb2.com/file/common-mechanism-dbs/common-mechanism-dbs.zip \
&& unzip 'commec-dbs.zip' -d /commec-dbs && rm \
commec-dbs.zip || true

Install from source

You can install from source, which may be useful for development. The main branch should contain release-ready code, while feature development should begin from the develop branch.

# Clone repository
git clone https://github.com/ibbis-screening/common-mechanism.git
cd common-mechanism

# Create conda environment from environment.yaml
conda env create -f environment.yaml
conda activate commec-dev

To update the locally-installed package, use the following commands:

conda activate commec-dev
conda env update -f environment.yaml --prune [-n commec-dev]

You can give the environment a custom name (other than commec-dev) by adding --name custom-name to both the env create and env update commands.

Troubleshooting

If you see one of the following errors:

 BLAST Database error: Error: Not a valid version 4 database.
 Error: Database was built with a different version of Diamond and is incompatible.

It is likely because defaults conda channel contains outdated versions of dependencies for both Diamond and BLAST, and so if you don't set a strict channel priority that includes conda-forge​ at the top, you end up stuck with really old versions of Diamond and BLAST.

This can be solved by running the following commands in order (which is part of Bioconda setup):

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict

For further assistance, please open an issue on our GitHub repository.

Installing the commec databases

Before running the Common Mechanism, you must install the databases referenced for sequence screening. commec requires different databases depending on your usage.

Install with commec setup (recommended)

You can run commec setup to interactively download the databases you need.

After installation, your database directory should look like this:

[databases_path]/
├── biorisk/	(~350 MB)
├── low_concern/   (~1.2 GB)
├── nr_dmnd/  	(~276 GB - optional)
├── nr_blast/ 	(~375 GB - optional)
├── nt_blast/ 	(~230 GB - optional)
└── taxonomy/ 	(~450 MB - optional)

Required: Core databases (~2 Gb)

These custom databases are hosted in Github Large File Storage, and can be downloaded from the commec-databases repository

Pick the latest release, and extract the commec-dbs.zip into your chosen database directory.

Taxonomy databases (Required for Full Analysis)

Unless you are only planning to screen in --skip-tx mode, you will need databases to perform the taxonomy search. These include: 

NCBI nr (~375 Gb)

BLAST database files are available through the NCBI BLAST FTP site, but since your `commec` conda environment should contain the blast+ command-line tools, we recommend installing using the following commands:

mkdir [databases_path]/blast_nr
cd [databases_path]/blast_nr
update_blastdb.pl --passive --decompress nr

If you are having trouble running the command after installing BLAST with conda, edit the first line of the update_blastdb.pl script in your environment bin to use /usr/bin/env perl instead of /usr/bin/perl.

NCBI taxonomy (<1 Gb)

Please download the NCBI taxonomy database using the following commands:

mkdir [databases_path]/taxonomy
wget -c ftp\://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz 
tar -zxvf taxdump.tar.gz
cp names.dmp nodes.dmp delnodes.dmp merged.dmp [databases_path]/taxonomy

NCBI core_nt: required except if --skip-nt (~230 Gb)

We recommend using NCBI's core_nt for the nucleotide BLAST step. It is smaller and faster than the full nt database while retaining the sensitivity required for commec screen, and it is what commec screen uses by default.

BLAST database files are available through the NCBI BLAST FTP site, but since your `commec` conda environment should contain the blast+ command-line tools, we recommend installing using the following commands:

mkdir [databases_path]/blast_nt
cd [databases_path]/blast_nt
update_blastdb.pl --passive --decompress core_nt

DIAMOND-formatted nr: only required if --protein-search-tool 'diamond' (~276 Gb)

We have found that DIAMOND is faster than BLAST for some searches, especially when testing obfuscated sequences. If you wish to test the relative speed and accuracy of BLAST vs DIAMOND search on your machine, you will need a DIAMOND-formatted nr database.

You may format a database yourself if you wish, but please feel free to get in touch with the maintainers (screening@ibbis.bio) for an AWS S3 download link to an nr_dmnd folder which contains the DIAMOND database for NCBI nr (non-redundant) proteins built specifically for the Common Mechanism. The database contains 6 different parts, allowing DIAMOND to align input sequences against each section of the NCBI nr database in parallel, speeding up the search algorithm.

Next Steps


Tutorial (v1.0)

This tutorial will guide you through your first DNA sequence screening using commec. We'll start with lightweight screening using --skip-tx and then explore more advanced features.

  1. Quickstart with skip taxonomy
  2. Using YAML to configure commec screen
  3. Interpreting commec screen results
  4. Interpreting commec flag outputs

Quickstart with skip taxonomy

For most users, this is the fastest way to get started and ensure the package has installed correctly:

# Download core databases using commec setup (~2GB)
commec setup

You should then create a config YAML file pointing to your databases (you can add any other parameters you will want by default). We recommend running with 4 threads:

cat <<EOF > config.yaml
base_paths:
  default: /mnt/data/home/ec2-user/cm-dbs/
threads: 4
EOF

You can now run a truncated commec screen on an input FASTA of your choice with:

commec screen --skip-tx input.fasta -y config.yaml

Using YAML to configure commec screen

We recommend configuring your commec screen runs by providing a YAML file:

commec screen input.fasta -y config.yaml

By default, the commec package will use the screen-default-config.yaml included in the package to provide defaults for all screen parameters not provided on the command line. This file has the following contents:

base_paths:
  default: commec-dbs/
databases:
  biorisk:
    path: '{default}biorisk/biorisk.hmm'
    taxids: "{default}biorisk/reg_taxids.txt"
    annotations: '{default}biorisk/biorisk_annotations.csv'
  regulated_protein:
    blast:
      path: '{default}nr_blast/nr'
    diamond:
      path: '{default}nr_dmnd/nr.dmnd'
  regulated_nt:
    path: '{default}nt_blast/core_nt'
  low_concern:
    rna:
      path: '{default}low_concern/rna/low_concern.cm'
    dna:
      path: '{default}low_concern/dna/low_concern.fasta'
    protein:
      path: '{default}low_concern/protein/low_concern.hmm'
    taxids: "{default}low_concern/vax_taxids.txt"
    annotations: '{default}low_concern/low_concern_annotations.tsv'
  taxonomy:
      path: "{default}taxonomy/"
threads: 1
diamond_jobs: null
do_cleanup: False
force: False
skip_taxonomy_search: False
protein_search_tool: 'blastx'
resume: False
skip_nt_search: False
verbose: False

Pointing to locally-installed databases directory

Most users will not have downloaded databases to commec-dbs and will want to override the default databases directory. If you have placed all of your databases in a single directory, you may be able to only override the default base path, for example by providing the following override yaml in the command line:

default_override.yaml

base_paths:
  default: /mnt/cloud-user/data/commec-dbs/

Overriding default gives you the same behaviour as providing that directory to the -d/--databases argument:

# These commands will behave identically
commec screen --skip-tx input.fasta -y default_override.yaml
commec screen --skip-tx input.fasta -d /mnt/cloud-user/data/commec-dbs/

Pointing to locally-installed databases in multiple locations

More complex overrides are possible. For example, if you are on a shared compute cluster that already has NCBI databases installed, and you know that you want your runs to use up to 4 threads, you might use the following configuration:

db_config.yaml

base_paths:
  default: /mnt/cloud-user/data/commec-dbs/
  ncbi: /mnt/share/bioinformatics/ncbi/blast/
databases:
  regulated_nt:
    path: '{ncbi}/nt_core/nt'
  regulated_protein:
    blast:
      path: '{ncbi}/nr/nr'
threads: 4

You can combine YAML configuration and command-line flags. For example, if you want to debug a run using the above configuration, and test whether it’s faster with 8 threads, you might run:

commec screen input.fasta -y db_config.yaml --threads 8 -v

Warning: YAML hierarchy matters

Configuration is loaded based on the hierarchical structure in screen-default-config.yaml. Your overrides must follow the same hierarchical structure; values outside of this structure will not be used. Contrast:

db_config.yaml

base_paths:
  default: /mnt/cloud-user/data/commec-dbs/
  ncbi: /mnt/share/bioinformatics/ncbi/blast/
databases:
  regulated_nt:
    path: '{ncbi}/nt_core/nt'

resulting in the regulated_nt path being set to /mnt/share/bioinformatics/ncbi/blast/nt_core/nt, but this, because of the missing top-level databases field, will not:

error_in_formatting_confg.yaml

base_paths:
  default: /mnt/cloud-user/data/commec-dbs/
  ncbi: /mnt/share/bioinformatics/ncbi/blast/
  regulated_nt:
    path: '{ncbi}/nt_core/nt`

and regulated_nt will be set to /mnt/cloud-user/data/commec-dbs/nt_blast/nt (the default path, using the user-specified default base_path).

Interpreting commec screen results

The common mechanism repository includes a directory of example_data/.

The examples include queries that illustrate different possible screening outcomes, and the directory contains the results of results of running commec screen on the mutli-query .fasta containing the examples.

We can interrogate the outcome of commec screen for each example through its entries in the _summary.html graphical report, as well the output.json data file.

Example output directory structure

The output file structure of commec screen, here using -o /output/ and example.fasta creates the following directory structure:

output/                               # Parent directory
├── example_input/                    # Inputs to each screen step.
│   ├── example.cleaned.fasta         # a copy of the input fasta
│   ├── example.noncoding.fasta       # identified non-coding regions for step 3
│   ├── example.faa                   # 6-frame translations
│   └── example_config.yaml           # A copy of the .yaml used.
│
├── example_output/                   # Raw output data directory
│   ├── example.biorisk.hmmscan       # Raw Biorisk output, Step 1
│   ├── example.nr.blastx             # Raw Protein Taxonomy output
│   ├── example.nt.blastn             # Raw Nucleotide Taxonomy output
│   ├── example.lowconcern.blastn     # Raw Low concern dna output
│   ├── example.lowconcern.cmscan     # Raw low concern rna output
│   └── example.lowconcern.hmmscan    # Raw low concern protein output
│
├── example.output.json               # output .json summary file.
├── example_summary.html              # graphical summary .html file
└── example.screen.log                # text log for commec screen

Example 1: BBa_K5108009_creA_

This is a composite DNA part developed by 2024 iGEM team Toulouse-INSA-UPS for space exploration applications. It is an artificial operon composed of four basic parts: creatinase and creatinine amidohydrolase ORFs (creA BBa K5108003, crnA BBa K5108004) and two RBS (BBa K5108006, BBaK5108007) enabling their expression in the plant growth-promoting rhizobacteria, Pseudomonas fluorescens, enabling the metabolization of creatinine by this organism.

BBa_K5108009_creA_ HTML Report

Two regions of the sequence were found to contain a virulence factor matching a gene from the Metallopeptidase family M24 (within the creA ORF), despite creatinase not typically being classified as a virulence factor, though it may play supporting roles in pathogenesis.

The output.json file can be investigated to find full information, organised by query, here is the section for BBa_K5108009_creA_:

"Part:BBa_K5108009_creA_-": {
  "query": "Part:BBa_K5108009_creA_-",
  "length": 2058,
  "status": {
    "screen_status": "Warning",
    "biorisk": "Warning",
    "protein_taxonomy": "Pass",
    "nucleotide_taxonomy": "Skip",
    "low_concern": "Warning",
    "rationale": "Matches sequence with virulence factor."
  },
  "hits": {
    "PeptidaseM24": {
      "recommendation": {
          "status": "Warning",
          "from_step": "Biorisk Search"
      },
      "name": "PeptidaseM24",
      "description": " Metallopeptidase family M24",
      "ranges": [
          {
              "e_value": 1.3e-25,
              "match_start": 20,
              "match_end": 43,
              "query_start": 112,
              "query_end": 174
          },
          {
              "e_value": 1.3e-25,
              "match_start": 2,
              "match_end": 207,
              "query_start": 520,
              "query_end": 1167
          }
      ],
      "annotations": {
          "domain": [
              "not assigned"
          ],
          "regulated": [
              "Virulence Factor"
          ]
      }
    }
  }
},

Also, note that protein matches were detected but no uncovered nucleotide regions ≥50 bp to search were found, so the entire nucleotide taxonomy check was skipped, this additional information is present in the log file at the beginning of step 3:

 INFO    │  >> STEP 3: Checking regulated pathogen nucleotides...
 INFO    │   --> no noncoding regions >= 50 bases found for Part:BBa_K5108009_creA_-, skipping nt scan for query.

Example 2: encrypted

This DNA sequence contains an encrypted message generated using the CryptoGE®M algorithm developed by the 2016 iGEM team from Groningen. It is therefore an entirely artificial sequence, with no biological function or related taxonomy across the domains of life.

Encrypted HTML Report

"encrypted": {
  "query": "encrypted",
  "length": 552,
  "status": {
    "screen_status": "Warning",
    "biorisk": "Pass",
    "protein_taxonomy": "Pass",
    "nucleotide_taxonomy": "Pass",
    "low_concern": "Pass",
    "rationale": "No matches found during any stage of analysis. Sequence risk is unknown, possibly generated in silico. "
  },
  "hits": {}
},

No flags were raised by the nucleotide search; you can see that the nucleotide screen was not skipped because all protein hits were <90% identity (perhaps because the sequence was AI-engineered).

This sequence 'passes' all screening steps, however a lack of any identified taxonomy or biorisk hits (<90% identity) is indicative of the generated nature of the sequence, and this is suggested in the rationale text.

Example 3: xylanase_zero_shot_des31

This sequence is one of the xylanase variants used in the zero-shot enzyme activity prediction challenge problem from Align Bio’s 2023 Protein Engineering Tournament. Xylanase is an enzyme that degrades the second-most-abundant polysaccharide and should not be flagged.

Xylanase Zero Shot HTML Report

"xylanase_zero_shot_des31": {
  "query": "xylanase_zero_shot_des31",
  "length": 756,
  "status": {
    "screen_status": "Pass",
    "biorisk": "Pass",
    "protein_taxonomy": "Pass",
    "nucleotide_taxonomy": "Pass",
    "low_concern": "Pass",
    "rationale": "No regions of concern."
  },
  "hits": {}
},

No flags were raised by any of the screening steps, meaning that none of the >90% Identity taxonomy hits are labelled as regulated.

Example 4: BBa_K209429_A_15261

BBa_K209429_A_15261 HTML Report

This sequence is another composite DNA part created by the igem UCSF team in 2009 with the goal of manipulating signaling pathways to mediate chemotaxis.

We can quickly see that there are two smaller regions that have matched regulated proteins from Salmonella enterica and Francisella tularensis. Importantly, these regions also match with 7 and 12 non-regulated proteins respectively. One of these matches is to a hypothetical protein reading frame, and another to a multispecies: APH(3')-I family aminoglycoside O-phosphotransferase.

"BBa_K209429_A_15261": {
  "query": "BBa_K209429_A_15261",
  "length": 9646,
  "status": {
    "screen_status": "Pass",
    "biorisk": "Pass",
    "protein_taxonomy": "Pass",
    "nucleotide_taxonomy": "Pass",
    "low_concern": "Pass",
    "rationale": "No regions of concern."
  },
  "hits": {
    "ECC4931537": {
      "recommendation": {
        "status": "Pass",
        "from_step": "Protein Taxonomy Search"
      },
      "name": "ECC4931537",
      "description": "hypothetical protein [Salmonella enterica]",
      "ranges": [
        {
          "e_value": 1.35e-33,
          "match_start": 1,
          "match_end": 66,
          "query_start": 2066,
          "query_end": 2263
        }
      ],
      "annotations": {
        "domain": [
            "Bacteria"
        ],
        "regulated_taxonomy": [
          {
            "number_of_regulated_taxids": "1",
            "number_of_unregulated_taxids": "7",
            "regulated_eukaryotes": "0",
            "regulated_bacteria": "1",
            "regulated_viruses": "0",
            "regulated_taxids": [
              "90370"
            ],
            "non_regulated_taxids": [
              "28901",
              "321846",
              "573",
              "670",
              "77133",
              "85831",
              "913074"
            ],
            "regulated_species": [
              "Salmonella enterica"
            ]
          }
        ]
      }
    },
    "WP_099588326": {
      "recommendation": {
          "status": "Pass",
          "from_step": "Protein Taxonomy Search"
      },
      "name": "WP_099588326",
      "description": "MULTISPECIES: APH(3')-I family aminoglycoside O-phosphotransferase [Bacteria]",
      "ranges": [
          {
              "e_value": 8.72e-179,
              "match_start": 1,
              "match_end": 269,
              "query_start": 1026,
              "query_end": 1832
          }
      ],
      "annotations": {
        "domain": [
            "Bacteria"
        ],
        "regulated_taxonomy": [
          {
            "number_of_regulated_taxids": "1",
            "number_of_unregulated_taxids": "12",
            "regulated_eukaryotes": "0",
            "regulated_bacteria": "1",
            "regulated_viruses": "0",
            "regulated_taxids": [
              "119857"
            ],
            "non_regulated_taxids": [
              "139",
              "1396",
              "1496",
              "1590",
              "1718",
              "2071714",
              "2801916",
              "3018075",
              "47715",
              "562",
              "66855",
              "99822"
            ],
            "regulated_species": [
              "Francisella tularensis"
            ]
          }
        ]
      }
    }
  }
}

The regions are shared across a range of non-regulated organisims, and are likely of non-concern, the protein taxonomy screening step is a 'pass' due to the mix of regulated and non-regulated organisms.

Example 5: RVFV_Rift_valley_fever

RVFV_Rift_valley_fever HTML Report

Here the Rift Valley Fever virus sample is successfully flagged during the taxonomic steps as containing extensive regions of material from regulated organisms, namely Phlebovirus riftense aka Rift Valley Fever virus, nucleocapsid proteins.

We encourage the reader to browse the output.json entry for this query themselves to be familarised to the format of extensive hits.

Interpreting commec flag outputs

The commec flag command produces a CSV. Each line in each CSV corresponds to a screen result of a individual query (i.e. a record from an input fasta file). It summarises the outcome at each screening step, as well as some additional information such as whether a particular superkingdom was present in taxonomy, as well as whether cleared regions were from RNA, DNA, or protein sources.

screen_pipeline_status

The screen_pipeline_status.csv file has the following values:

Column Name Type Description
name str Name of screen file
filepath path Path to screen file
flag status Outcome of the overall screen
biorisk status Outcome of the biorisk search
protein status Outcome of the protein taxonomy search
nucleotide status Outcome of the nucleotide taxonomy search
cleared status Outcome of the low-concern search
virus_flag bool Did the taxonomy search flag sequences from a regulated virus?
bacteria_flag bool ... or a regulated bacterial species?
eukaryote_flag bool ... or a regulated eukaryotic (e.g. fungal) species?
cleared_protein bool Were any flags cleared by the low_concern protein search?
cleared_rna bool ... or the low_concern RNA search?
cleared_dna bool ... or the low_concern DNA search?

Note that the biorisk, protein and nucleotide search columns may take multiple status values due to having multiple hits. The "status" columns can take the following values:

Value Meaning
flag The sequence was flagged in this step
pass The sequence passed in this step
skip This step was intentionally not run
error An error occurred during this step
- This step was not run due to an error, interrupt, or other unexpected outcome
mixed (protein/nucleotide only) Equally-good best match is to regulated- and non-regulated organisms
warn (biorisk only) Significant hit to a virulence factor, but these are often shared between regulated and non-regulated organisms
flag (cleared) All flags were cleared during the non-concern step

As an example of a screen flag output, here is the output for the previous 5 examples:

formatted:

name filepath flag biorisk protein nucleotide low_concern virus_flag bacteria_flag eukaryote_flag low_concern_protein low_concern_rna low_concern_dna
Part:BBa_K5108009_creA_- commec-examples.output.json Warning Warning Pass Skip Warning False False False False False False
encrypted commec-examples.output.json Warning Pass Pass Pass Pass False False False False False False
xylanase_zero_shot_des31 commec-examples.output.json Pass Pass Pass Pass Pass False False False False False False
RVFV_Rift_valley_fever commec-examples.output.json Flag Warning Flag Flag Flag True False False False False False
BBa_K209429_A_15261 commec-examples.output.json Pass Pass Mixed Pass Pass False True False False False False

raw:

name,filepath,flag,biorisk,protein,nucleotide,low_concern,virus_flag,bacteria_flag,eukaryote_flag,low_concern_protein,low_concern_rna,low_concern_dna
Part:BBa_K5108009_creA_-,2025-08-06/commec-examples.output.json,Warning,Warning,Pass,Skip,Warning,False,False,False,False,False,False
encrypted,2025-08-06/commec-examples.output.json,Warning,Pass,Pass,Pass,Pass,False,False,False,False,False,False
xylanase_zero_shot_des31,2025-08-06/commec-examples.output.json,Pass,Pass,Pass,Pass,Pass,False,False,False,False,False,False
RVFV_Rift_valley_fever,2025-08-06/commec-examples.output.json,Flag,Warning,Flag,Flag,Flag,True,False,False,False,False,False
BBa_K209429_A_15261,2025-08-06/commec-examples.output.json,Pass,Pass,Mixed,Pass,Pass,False,True,False,False,False,False

Command Line Usage (v1.0)

This guide provides instructions on how to use commec for DNA sequence screening. commec provides four subcommands: screen, flag, split and setup.

# Run screening on a FASTA file
commec screen -d /path/to/databases input.fasta

# Parse screen files and generate flag CSVs
commec flag /path/to/directory/with/screen/files

# Split a multi-record FASTA file into individual files, one for each record
commec split input.fasta

# Interactively download databases needed for screening
commec setup

screen

The screen command runs a sequence through the following screening steps:

  1. Biorisk search: Fast HMM-based search against curated sequence profiles
  2. Taxonomy Search: look for best matches to regulated pathogens using a two-step process:
    • Protein search: BLASTX/DIAMOND search against NCBI nr
    • Nucleotide search: BLASTN search against NCBI core_nt (optional; core_nt is recommended over the full nt database — smaller and faster while retaining the sensitivity needed for commec screen)
  3. Low-concern search: Clear earlier flags based on matches to house-keeping or low-concern sequences

Required Arguments

You must provide a database path either through the -d argument of via a configuration YAML file.

Argument Type Description
fasta_file Required FASTA file to screen. Should only contain a single query
-d DATABASE_DIR, --databases DATABASE_DIR Required (unless -y specified) Path to directory containing reference databases (e.g. taxonomy, protein, HMM)
-y CONFIG_YAML, --config CONFIG_YAML Required (unless -d specified) Configuration for screen run in YAML format, including custom database paths
Screen run logic options
-p {blastx,diamond}, --protein-search-tool {blastx,diamond} Optional Tool for protein homology search to identify regulated pathogens (default: blastx)
--skip-tx Optional flag Skip protein and nucleotide search (regulated pathogens will only be identified based on biorisk search)
--skip-nt Optional flag Skip nucleotide search (regulated pathogens will only be identified based on protein hits)
Parallelisation options
-t THREADS, --threads THREADS Optional Maximum number of CPU threads to use. Passed to search tools. (default: 1)
-j DIAMOND_JOBS, --diamond-jobs DIAMOND_JOBS Optional, diamond-only Number of runs to do in parallel on split Diamond database (to increase speed, DIAMOND databases have been split into several parts)
Output options
-v, --verbose Optional flag Output verbose (i.e. DEBUG-level) logs
-o OUTPUT_PREFIX, --output OUTPUT_PREFIX Optional Prefix for output files. Can be a string (interpreted as output basename) or a directory (files will be output there, names determined from input FASTA). Defaults to location of input FASTA.
-c, --cleanup Optional flag Delete intermediate output files for run
-F, --force Optional flag Overwrite any pre-existing output for run (cannot be used with --resume)
-R, --resume Optional flag Re-use any pre-existing output for run (cannot be used with --force)

Examples

See Using YAML to configure your commec runs above in this archive (recommended).

# minimal setup example (only commec biorisk databases ~1.2 GB)
commec screen -d ~/databases --skip-tx input.fasta

# Multi-threaded full analysis with DIAMOND
commec screen -d ~/databases -t 8 -p diamond input.fasta

# Custom output location, skip nucleotide search
commec screen -d ~/databases -o results/my-screen --skip-nt input.fasta

# All configuration can be done through YAML (recommended)
commec screen -y config.yaml input.fasta

flag

The flag command produces a CSV. Each line in each CSV corresponds to query from commec generated .output.json files.

Argument Type Description
directory Required Directory containing .output.json files to summarize
-o OUTPUT, --output OUTPUT Optional Output directory name (defaults to directory name if not provided)
-r, --recursive Optional flag Search directory recursively for json files

Example

commec flag -r ~/commec-results/2025-04/ -o ./flags-2025-04-03

See Interpreting commec flag outputs above in this archive.

setup

This is an interactive helper script for downloading the databases required for running screen

Argument Type Description
-a, --auto Optional flag Don't ask for user input, and use default options for everything

Example

commec setup

split

This is a small helper script to split a multi-record FASTA file into individual files, one for each record.

Argument Type Description
fasta_file Required FASTA file to split

Example

commec split multi_record.fasta

Extending With Your Own Databases (v1.0)

You can easily extend the Common Mechanism to include your own databases. 

Taxon IDs to flag

If you want to add additional taxon IDs for the Common Mechanism to flag if it finds a best match, you can add them to reg_taxids.txt in the biorisk_db folder. 

Taxon IDs to clear

If you want to add additional taxon IDs for the Common Mechanism to clear if it finds a best match to a sub-variant of a regulated pathogen that is safe to order (e.g. a vaccine strain), you can add them to vax_taxids in the biorisk_db folder. 

Protein families to flag

If you want to make additional profile HMMs for the Common Mechanism to search for, simply create a multifasta of your protein sequences, and run build_hmms.sh. You can then add the models to the biorisk database in the biorisk folder:

Usage:

build_hmms.sh -f [multifasta.fasta] -n database_name
sort database_name.hmm biorisk.hmm > biorisk.hmm
rm biorisk.hmm.h*
hmmpress biorisk.hmm

Dependencies: mmseqs, hmmer

You will then need to add rows to the biorisk_annotations.csv file. The rows must contain the names of the HMMs, a description, and a Must flag designation.

  • Must flag = TRUE, the protein families will be flagged if they are detected in an order.
  • Must flag = FALSE, they will only be flagged if the region also contains a best match to a regulated pathogen, and will be marked with a WARNING otherwise. 

Protein families to clear

If you want to incorporate your own collection of known low concern proteins, you can follow a similar process in the low_concern folder:

build_hmms.sh -f [multifasta.fasta] -n database_name
cat database_name.hmm benign.hmm > benign.hmm
rm biorisk.hmm.h*
hmmpress benign.hmm

Clone this wiki locally