CALANGO (Comparative AnaLysis with ANnotation-based Genomic cOmponentes) is a first-principles comparative genomics tool. It searches for annotation terms, such as GO terms or Pfam domain IDs, associated with a quantitative variable used to rank species data. It can be used to annotate genomes at any level, including protein domains, genes, or promoters.
The increasing availability of high-quality genomic, annotation and phenotypic data for different species contrasts with the lack of general software for comparative genomics that integrates these data types in a statistically sound framework in order to produce biologically meaningful knowledge. In this work, we present CALANGO (Comparative AnaLysis with ANnotation-based Genomic cOmponentes), a first-principles comparative genomics tool to search for annotation terms, such as GO terms or Pfam domain IDs, associated with a quantitative variable used to rank species data, after correcting for phylogenetic relatedness. This information can be used to annotate genomes at any level, including protein domains, genes, or promoters, allowing comparative analyses of genomes at several resolutions and from distinct functional and evolutionary angles. CALANGO outputs a set of HTML5 files that can be opened in any conventional web browser, featuring interactive heatmaps, scatter plots, and tables, stimulating scientific reproducibility, data sharing, and exploratory analysis. Detailed results and a reproducibility-focused data structure are also returned after each run of the tool. CALANGO provides classic association statistics used in comparative genomics, including correlation coefficients, probabilities, and phylogeny-aware linear models. To illustrate how CALANGO can be used to produce biologically meaningful, statistically sound knowledge, we present a case study of the co-evolution of Escherichia coli and their integrated bacteriophages (prophages). Through controlled in silico experiments, we demonstrate that terms from a functional annotation are both more prevalent across genomes and more abundant than the homology-based annotation terms commonly used in traditional comparative genomics studies. This result demonstrates how GO-based annotation captures information of non-homologous sequences fulfilling the same biological roles. Most homologous regions positively associated with prophage occurrence are found in genes of viral origin (e.g. capsids, lysozymes, and integrases), as expected, while the second most abundant category is virulence factors. The removal of viral genes demonstrated that most of the virulence factors associated with prophage density are located outside viral genes, suggesting a more complex biological process than the archetypal bacteriophage-mediated horizontal gene transfer of virulence factors. The functional annotation performed by CALANGO revealed several GO terms describing general and specific aspects of viral biology (e.g. "viral life cycle", "DNA integration"). We also found an association of the GO term "pathogenicity", used to annotate several non-homologous virulence factors, as well as terms describing several known virulence mechanisms in pathogenic E. coli (e.g. "Type III secretion system"). Moreover, CALANGO also detected previously unknown associations that unveil a richer scenario of the bacteriophage-host biological interaction. An interesting example is the association of GO term "response to stress", used to annotate several classes of non-homologous genes components of distinct stress response mechanisms (e.g. peroxidases, DNA repair enzymes, heat shock proteins), indicating that the horizontal transfer of such genes may be adaptive for host cells and, consequently, advantageous for the integrated prophages as well. CALANGO is provided as a fully operational, out-of-the-box R package that can be freely installed directly from CRAN. Usage examples and longer-format documentation are also available at maintainer's github page.