An anvi'o program to compute a pangenome from an anvi'o genome storage.

🔙 To the main page of anvi’o programs and artifacts.


Can consume


Can provide

pan-db misc-data-items-order


This program implements pangenomics, and organizes genes found within a genomes-storage-db to create a pan-db.

Please first read the pangenomics tutorial to have a better understanding of the steps that lead to the generation of a pan-db.

Making sure your installation can do pangenomics

You can always test if your computer has all the dependencies for a successful pangenomics analysis by running,

anvi-self-test --suite pangenomics

If it runs without errors, you’re golden. If not, please consult with the most up-to-date installation instructions for anvi’o and get in touch with the anvi’o community for guidance.

A brief summary

The program anvi-pan-genome performs three major things for its user:

  • Calculates the similarity between the all gene amino acid seqeunces found in genomes described in your genomes-storage-db using DIAMOND. You have some options. Although, (1) you can use the NCBI’s BLAST program blastp instead of DIAMOND using the --use-ncbi-blast flag, (2) instead of analyzing all genomes you can focus a subset using the --genome-names parameter, and (3) exclude genes that are partial from your analysis using the flag --exclude-partial-gene-calls if you think you must.

  • Resolves gene clusters using the BLAST results via the MCL algorithm after discarding weak hits from the search results using the --minbit heuristic (inspired by the workflow implemented by ITEP (Benedict et al., 2014).

  • Perform post-analyses of resulting gene clusters for downstream analyses and visualization (including aligning amino acid sequences in each cluster, computing functional and geometric homogeneity indices, and computing a hierarchical clustering of gene clusters in preparation for the visualization of the pangenome using the program anvi-display-pan.

The ‘additional parameters’ mechanism for power users

At the core of the pangenomics workflow lies the reciprocal BLAST search that identifies sequence similarities within a pool of gene sequences. For this, anvi’o uses DIAMOND by default, but the user can change the search algorithm. Based on the algorithm used for this step, the matching anvi’o driver sets some default parameters for a successful run. Such as the proper parameter to explicitly define where the output files generated by DIAMOND should go, and so on. Apart from those mandatory parameters that are critical for a successful run, anvi’o allows the user to define a set of additional parameters to pass to the search algorithm.

This is done via the flag --additional-params-for-seq-search. For instance, the user could take a look at the parameters diamond offers by typing diamond help on their terminal, and may decide to use the --sensitive implemented by DIAMOND to enable a slower but more sensitive search, and use the parameter --id 98 to ask DIAMOND to not report any hits across genes that is lower than 98% sequence identity to limit gene clusters only those sequences that are extremely closely related while pushing everything else to be singletons (which can also be removed from the analysis with a separate --min-occurrence 2 flag anvi-pan-genome accepts). They can pass these parameters to DIAMOND by running their analysis the following way:

anvi-pan-genome --genomes-storage genomes-storage-db \ --project-name PROJECT_NAME \ --additional-params-for-seq-search “--masking 0 --sensitive --id 98”

The additional parameters used for the search will be stored in the resulting pan-db and can be viewed anytime using the program anvi-display-pan.

For DIAMOND, if no additional parameters is declared, anvi’o will include --masking 0 by default since we recently learned that not using that flag leads to the elmination of genes with many repeated elements (see #1955).

With the freedom of additional parameters for sequnce search, it is possible to make significant mistakes since anvi’o will have no opportunity to sanity-check user-defined additional parameters. If you are doing something experimental, please keep an eye on the output messages and error logs.

If the user choses to use NCBI’s BLAST program, in that case anvi’o will pass the value of the parameter --additional-params-for-seq-search to NCBI’s blastp.

Edit this file to update this information.

Additional Resources

Are you aware of resources that may help users better understand the utility of this program? Please feel free to edit this file on GitHub. If you are not sure how to do that, find the __resources__ tag in this file to see an example.