- A pangenome is the complete collection of genetic information found across a group of individuals, strains, isolates, or populations belonging to the same species or closely related group. Unlike a reference genome, which represents the genome sequence of a single individual or strain, a pangenome captures genetic diversity across multiple genomes. It includes genes shared by nearly all members of the group, genes present in only some members, and genes found in very few individuals. Pangenome analysis is an important area of comparative genomics because it helps researchers understand genome diversity, gene gain and loss, adaptation, evolution, pathogenicity, and differences in biological characteristics among organisms.
- The concept of the pangenome is particularly important in bacteria, where genomes within the same species can differ substantially in gene content. Two bacterial strains may share most of their essential genes but possess different accessory genes associated with antibiotic resistance, virulence, metabolism, environmental adaptation, or host specificity. Pangenomics is also increasingly applied to plants, animals, fungi, and other eukaryotes, where genetic variation, structural differences, gene presence–absence variation, and population diversity can be studied across multiple individuals.
- The pangenome is commonly divided into two major components: the core genome and the accessory genome. The core genome consists of genes shared by all, or nearly all, genomes included in a particular analysis. These genes often perform essential biological functions, such as DNA replication, transcription, translation, basic metabolism, and cellular maintenance. However, a gene identified as part of the core genome is not automatically essential under every biological condition. Core status depends on the organisms sampled, the quality of genome assemblies and annotations, and the threshold used to define how widely a gene must be distributed.
- The accessory genome contains genes that are not present in every member of the studied group. It includes genes found in several but not all genomes, as well as genes detected in only one or a small number of genomes. Accessory genes may contribute to specialized metabolic pathways, environmental adaptation, nutrient utilization, host interactions, antibiotic resistance, virulence, stress responses, and other characteristics. Their distribution can reflect evolutionary processes such as horizontal gene transfer, gene duplication, gene loss, recombination, and adaptation to different ecological environments.
- The accessory genome is sometimes divided into additional categories according to the frequency of genes among sampled genomes. Genes found in a large proportion of genomes but not in all are often called soft-core genes. Genes present in an intermediate proportion are commonly described as shell genes, while genes found in only a small proportion are often called cloud genes. These categories are useful for describing gene-frequency patterns, but their exact definitions vary among analytical methods. Some tools use different thresholds or terminology, so researchers should report the criteria applied in each study.
- A simple example illustrates the relationship between core and accessory genomes. Suppose that researchers sequence ten bacterial strains belonging to the same species. If a gene is detected in all ten strains, it belongs to the core genome under a strict definition. If it occurs in seven strains, it may be classified as an accessory or shell gene, depending on the thresholds used. If it occurs in only one strain, it may be considered a rare accessory or cloud gene. The complete set of distinct genes identified across all ten strains forms the pangenome. This example demonstrates that a species does not necessarily possess one fixed gene collection shared by every member; instead, its genetic content can vary among strains and populations.
- Pangenome analysis begins with the selection of suitable genomes representing the biological group under investigation. Researchers may use complete genomes, draft assemblies, or high-quality genome sequences obtained from public databases or newly generated sequencing projects. The selected genomes should have reliable taxonomic identification, adequate sequencing quality, and consistent annotation. Genome quality is particularly important because incomplete assemblies can cause genes to appear absent when they are actually present but were not assembled or annotated. Contamination, fragmented contigs, inconsistent gene prediction, and incorrect taxonomic classification can also distort pangenome estimates.
- Genome assembly and annotation are therefore important preliminary steps. Tools such as QUAST can be used to assess assembly statistics, while BUSCO can estimate completeness by examining expected conserved genes. For bacterial genome projects, CheckM and CheckM2 can help assess genome completeness and contamination. Prokka, Bakta, and NCBI’s Prokaryotic Genome Annotation Pipeline can be used for bacterial genome annotation. When possible, all genomes should be annotated using a consistent pipeline and comparable parameters. This reduces differences caused by annotation methods rather than genuine biological variation.
- After genome preparation, genes are identified and compared across the selected genomes. Because gene sequences can differ through mutation, recombination, and evolutionary divergence, researchers must determine which genes are sufficiently similar to be considered members of the same gene family or orthologous group. Orthology inference is a central step in pangenome construction. Two genes are generally considered orthologous when they descended from the same ancestral gene through a speciation event, although practical computational methods often use sequence similarity, clustering, and additional evolutionary evidence to approximate these relationships.
- Several approaches are used to identify corresponding genes across genomes. Sequence similarity searches can be performed using BLASTP or DIAMOND, followed by clustering methods that group related protein sequences. Tools such as OrthoFinder, OrthoMCL, and SonicParanoid can identify orthogroups across multiple organisms. For bacterial pangenome analysis, specialized tools such as Roary, Panaroo, PIRATE, and PPanGGOLiN are widely used. Their methods differ in clustering strategy, handling of fragmented genes, paralogs, annotation errors, and gene-family organization. Consequently, different tools may produce different estimates of the core and accessory genomes from the same input dataset.
- Panaroo is designed for bacterial pangenome analysis and includes procedures intended to identify and correct certain gene annotation and clustering inconsistencies by considering the relationships among genes and their genomic neighborhoods. Roary provides a widely used approach for clustering bacterial protein sequences and generating gene presence–absence matrices. PIRATE supports pangenome analysis across different levels of sequence similarity, while PPanGGOLiN uses a partitioning approach to organize gene families into persistent, shell, and cloud components. The appropriate method depends on the organism, dataset size, sequence diversity, annotation quality, and research question.
- A gene presence–absence matrix is one of the main outputs of pangenome analysis. In this matrix, rows represent gene families or orthologous groups, while columns represent individual genomes. A value indicates whether a particular gene family is detected in a genome. For example, a value of 1 may indicate presence and 0 may indicate absence. Some programs also provide information about gene copy number, sequence identity, genomic coordinates, or confidence in the assignment. The matrix makes it possible to calculate the frequency of each gene family, classify genes into core and accessory categories, and identify differences among genomes.
- A simplified presence–absence matrix may look like this:
Gene_Family Strain_1 Strain_2 Strain_3 Strain_4
Gene_A 1 1 1 1
Gene_B 1 1 0 1
Gene_C 0 1 1 0
Gene_D 1 0 0 0
Gene_E 1 1 1 1
- In this example, Gene_A and Gene_E are present in all four strains and therefore belong to the strict core genome. Gene_B is present in three strains and is part of the accessory genome under a strict definition. Gene_C is found in two strains, while Gene_D occurs in only one strain. Together, all five gene families represent the pangenome identified in the four-strain dataset. This matrix is illustrative; real pangenome software may produce additional columns, annotations, and gene-family identifiers.
- The size of a pangenome is an important measure of genomic diversity. It represents the number of distinct gene families identified across the sampled genomes. The core genome represents the shared component, while the accessory genome represents the additional gene diversity found among members of the group. Researchers often compare the sizes of these components across species, populations, ecological groups, or clinical and environmental isolates. However, pangenome size depends strongly on the number and diversity of genomes sampled, the quality of genome sequences, the annotation method, and the clustering thresholds used.
- Pangenomes are commonly described as open or closed. An open pangenome continues to acquire new gene families as additional genomes are sampled. This pattern is often observed in bacterial species with substantial ecological diversity, frequent horizontal gene transfer, and access to diverse gene pools. A closed pangenome approaches a stable number of gene families as more genomes are added, meaning that additional genomes contribute relatively few previously unobserved gene families. These descriptions are statistical and dataset-dependent rather than absolute biological properties. A species classified as having an open pangenome under one sampling strategy may appear more nearly closed under a narrower or less diverse sampling strategy.
- Pangenome development can be examined using gene accumulation curves. These curves show how the number of distinct gene families changes as additional genomes are included. The core genome is often examined using a corresponding curve that tracks the number of gene families shared by all genomes in progressively larger subsets. As more genomes are added, the observed pangenome generally increases or remains unchanged, while the strict core genome generally decreases or remains unchanged. Researchers may use mathematical models to estimate whether the pangenome is likely to remain open or approach a finite size. Such estimates depend on assumptions about genome sampling, gene-frequency distributions, and the evolutionary history of the group.
- A simplified approach to calculating pangenome and core-genome sizes from a gene presence–absence matrix can be implemented in Python. The following example assumes that the first column contains gene-family identifiers and the remaining columns contain binary presence–absence values.
import pandas as pd
# Read a gene presence-absence matrix
matrix = pd.read_csv(“gene_presence_absence.csv”)
# Select genome columns
genome_data = matrix.iloc[:, 1:]
# Convert values to numeric
genome_data = genome_data.apply(pd.to_numeric, errors=”coerce”).fillna(0)
# Number of genomes
number_of_genomes = genome_data.shape[1]
# Calculate the number of genomes containing each gene family
gene_frequency = (genome_data > 0).sum(axis=1)
# Strict core: present in every genome
core_genes = gene_frequency == number_of_genomes
# Accessory: present in at least one but not all genomes
accessory_genes = (
(gene_frequency > 0) &
(gene_frequency < number_of_genomes)
)
# Total pangenome: present in at least one genome
pangenome_size = int((gene_frequency > 0).sum())
# Calculate component sizes
core_size = int(core_genes.sum())
accessory_size = int(accessory_genes.sum())
print(“Pangenome size:”, pangenome_size)
print(“Core genome size:”, core_size)
print(“Accessory genome size:”, accessory_size)
- This example provides a basic calculation based on a binary presence–absence matrix. If the matrix contains gene copy numbers, values greater than zero are treated as presence. Missing values should be investigated rather than automatically interpreted as gene absence, because missing data can represent incomplete assemblies, failed annotations, or unavailable information. In real analyses, researchers should also consider whether the software has already filtered low-confidence gene clusters or corrected annotation inconsistencies.
- A more advanced analysis can classify gene families into core, soft-core, shell, and cloud categories using frequency thresholds. For example, a researcher may define a core gene as one present in 100% of genomes and a soft-core gene as one present in at least 95% of genomes. These thresholds are illustrative rather than universal. The appropriate values depend on the number of genomes, their quality, the biological group, and the objectives of the study. A strict core definition can be sensitive to even one missing or incorrectly annotated gene, while a relaxed definition may better represent genes that are broadly conserved across a population.
- Bacterial pangenome analysis is particularly useful for studying pathogenicity and antimicrobial resistance. Some bacterial strains carry accessory genes encoding toxins, adhesins, secretion systems, capsule components, antibiotic-resistance determinants, and other factors that influence interactions with hosts or environments. Comparing the pangenomes of pathogenic and non-pathogenic strains can identify gene families associated with particular phenotypes. However, the presence of a gene does not necessarily demonstrate that it is expressed or functionally active. Experimental validation, gene-expression analysis, functional studies, and appropriate statistical methods are needed to establish biological significance.
- Pangenomes also provide insight into horizontal gene transfer, one of the major mechanisms responsible for gene-content variation in many microorganisms. Genes can move between organisms through transformation, transduction, and conjugation, allowing strains to acquire new metabolic capabilities, resistance determinants, or virulence-associated functions. Mobile genetic elements, including plasmids, bacteriophages, transposons, and integrative conjugative elements, can contribute to the movement of accessory genes. Pangenome analysis can identify unusual gene distributions and candidate horizontally transferred genes, although additional phylogenetic and genomic-context evidence is required to establish horizontal transfer.
- In plants, pangenome analysis is valuable for understanding crop diversity, domestication, adaptation, and breeding potential. Different cultivars or accessions may contain genes that are absent from the reference genome. These genes can contribute to disease resistance, drought tolerance, salt tolerance, flowering time, yield, nutrient use, and other agronomic characteristics. A single reference genome may therefore fail to represent important genetic variation within a crop species. Plant pangenomes can combine multiple genome assemblies with gene presence–absence variation, structural variation, and sequence polymorphisms to provide a more complete representation of species diversity.
- Animal pangenomes are increasingly important for livestock genetics, conservation, and comparative genomics. Different breeds may possess distinct genetic variants, gene copies, structural rearrangements, and gene-content differences associated with adaptation, production, disease resistance, fertility, and other traits. Pangenome analysis can help identify genetic diversity that is poorly represented in a single reference genome. It may also support the discovery of breed-specific or population-specific genomic features. However, gene presence alone should not be interpreted as proof that a gene causes a particular production or health trait; association studies and functional validation are needed.
- The distinction between a linear reference genome and a pangenome graph is also important. A conventional reference genome represents one selected sequence, usually arranged as a linear chromosome or set of contigs. Other genomes are commonly aligned or compared against this reference. This approach can create reference bias when sequences or variants from other populations are poorly represented by the selected reference. A pangenome graph represents multiple related genomic sequences and their alternative paths within a shared structure. It can preserve sequence variation, insertions, deletions, and alternative genomic arrangements that may be absent from a single reference.
- Graph-based pangenomes are especially relevant for large and genetically diverse populations. They can improve the representation of structural variants and reduce some forms of reference bias in read mapping and variant discovery. Tools and frameworks used in this area include minigraph, minigraph-cactus, Cactus, VG, and PanGenie, although they support different stages and types of graph-based analysis. The construction and use of a pangenome graph require careful attention to genome assembly quality, sequence alignment, graph representation, and coordinate interpretation. Graph references do not eliminate all mapping or variant-calling errors, and their results depend on the genomes included in the graph.
- Gene presence–absence variation is a central feature of pangenomics. It describes differences in whether particular genes or gene families are detected across individuals or strains. Such variation may result from gene deletion, duplication, insertion, horizontal gene transfer, transposable elements, or other structural changes. It can influence biological functions and phenotypic diversity, but it can also be affected by technical factors such as sequencing coverage, assembly fragmentation, annotation differences, and the gene-clustering method. Distinguishing genuine biological absence from technical failure is therefore essential.
- Pangenome analysis can also be combined with phylogenetic analysis to investigate the evolutionary relationships among genomes. A core-genome alignment can be used to reconstruct a phylogeny based on genes shared across the selected genomes. For bacteria, researchers may construct a core-genome single-nucleotide polymorphism alignment or concatenate conserved orthologous genes. Tools such as MAFFT, IQ-TREE, and RAxML-NG can support sequence alignment and phylogenetic reconstruction. Accessory-gene patterns can provide complementary information about gene gain, gene loss, horizontal transfer, and ecological adaptation. However, accessory genes may have evolutionary histories that differ from the core genome, so a single tree may not adequately describe the history of every gene.
- Pangenome-wide association studies can investigate relationships between gene content and phenotypic characteristics. In bacteria, these approaches are often called bacterial GWAS or pangenome-wide association studies. Researchers may test whether particular gene families or genomic regions are associated with antibiotic resistance, virulence, host origin, or environmental adaptation. Methods implemented in tools such as Scoary and pyseer can support bacterial association analyses using gene presence–absence patterns or other genomic features. Population structure and shared ancestry must be considered because closely related strains may share genes and phenotypes for evolutionary reasons. Failure to account for population structure can produce misleading associations.
- Pangenome analysis also has important applications in microbiome research. Microbial communities contain multiple species and strains, each with different gene repertoires. Species-level pangenomes can help describe the functional potential of microbial populations and identify genes involved in nutrient metabolism, environmental interactions, host colonization, and antimicrobial resistance. Metagenome-assembled genomes can be included in some pangenome workflows, but their incompleteness and contamination must be evaluated. Strain-level variation can be difficult to resolve in complex communities, and the absence of a gene from a metagenomic assembly does not necessarily mean that the gene is absent from the original microbial population.
- Several limitations must be considered when interpreting pangenome results. First, the sampling of genomes strongly influences the estimated pangenome. A collection dominated by closely related strains may underestimate gene diversity, while a more diverse collection may reveal additional gene families. Second, incomplete genome assemblies can cause false gene absences, particularly when genes are located near contig boundaries or in repetitive regions. Third, inconsistent gene annotation can split equivalent genes into different clusters or combine distinct genes into the same family. Fourth, sequence-similarity thresholds and clustering algorithms can influence the number and composition of gene families. Highly divergent homologous genes may be separated, while paralogous genes with similar sequences may be grouped incorrectly.
- Another limitation concerns the interpretation of core and accessory genes. A core gene is not necessarily essential in every environment, and an accessory gene is not necessarily unimportant. Some accessory genes may have major effects on survival, host interaction, drug resistance, or adaptation. Similarly, a gene found in only one genome may represent genuine strain-specific biology, a recently acquired gene, a sequencing or annotation error, or contamination. Functional interpretation should therefore combine gene presence–absence patterns with sequence evidence, genomic context, expression data, experimental observations, and relevant biological knowledge.
- Reproducibility is essential in pangenome research. Researchers should document the genome accessions, assembly versions, taxonomic criteria, annotation software, software versions, clustering parameters, sequence-identity thresholds, and definitions used for core and accessory categories. The gene presence–absence matrix, representative gene sequences, and analysis scripts should be preserved when possible. When comparing results from different studies, it is important to check whether the same genome sampling strategy, gene-calling pipeline, clustering method, and frequency thresholds were used. Differences in these choices can produce different pangenome estimates even when the biological group is similar.
- Pangenomes and core/accessory genome analysis provide a broader view of genetic diversity than single-reference genome analysis. The core genome describes the shared genetic foundation of a group, while the accessory genome captures variation that may contribute to ecological adaptation, pathogenicity, metabolism, and population-specific characteristics. Together, these components help researchers investigate genome evolution, gene gain and loss, horizontal gene transfer, structural variation, and genotype–phenotype relationships. As sequencing technologies, genome assembly methods, and graph-based representations continue to develop, pangenomics is becoming increasingly important in microbial genomics, plant and animal breeding, evolutionary biology, medicine, and precision agriculture.