Skip to content

Build a reference database

Chloë Cornelissen edited this page Nov 13, 2026 · 2 revisions

Creating a custom database

For a custom CAT pack database, you must have the following input ready before you launch a CAT_pack prepare run.

  1. A fasta file containing all protein sequences you want to include in your database.

  2. A names.dmp file that contains mappings of taxids to their ranks and scientific names. The format must be the same as the NCBI standard names.dmp (uses \t|\t as field separator).

An example looks like this:

1	|	root	|	scientific name	|
2	|	Bacteria	|	scientific name	|
562	|	Escherichia	coli	|	scientific name	|
  1. A nodes.dmp file that describes the child-parent relationship of the nodes in the taxonomy tree and their (official) rank. The format must be the same as the NCBI standard nodes.dmp (uses \t|\t as the field separator).

An example looks like this:

1	|	1	|	no rank	|
2	|	1	|	superkingdom	|
1224	|	2	|	phylum	|
1236	| 1224	|	class	|
91437	|	1236	|	order	|
543	|	91347	|	family	|
561	|	543	|	genus	|
562	|	561	|	species	|

For more information on the nodes.dmp and names.dmp files, see the NCBI taxdump_readme.txt.

  1. A 2-column, tab-separated file containing the mapping of each sequence in the fasta file to a taxid in the taxonomy. This file must contain the header accession.version taxid.

An example looks like this

accession.version	taxid
protein_1	562
protein_2	123456

Once all of the above requirements are met you can run CAT_pack prepare. All the input needs to be explicitly specified for CAT_pack prepare to work, for example:

$ CAT_pack prepare \
--db_fasta path/to/fasta \
--names path/to/names.dmp \
--nodes path/to/nodes.dmp \
--acc2tax path/to/acc2taxid.txt.gz \
--db_dir path/to/output_dir

will create an output_dir that will look like this

output_dir
├── 2023-11-05_CAT_pack.log
├── 2023-11-05_CAT_pack.dmnd
├── 2023-11-05_CAT_pack.fastaid2LCAtaxid
├── 2023-11-05_CAT_pack.taxids_with_multiple_offspring
├── names.dmp
└── nodes.dmp

Notes:

  • All database and taxonomy files are stored together in output_dir. Use this directory with -d for CAT, BAT, RAT.
  • The nodes.dmp and names.dmp files in the output_dir directory are copied from their original location.
  • The default prefix is <YYYY-MM-DD>_CAT_pack. You can customize it with the --common_prefix option.

For all command line options available see

$ CAT_pack prepare -h

Clone this wiki locally