Contents

1 Introduction

Synteny analysis allows the identification of conserved gene content and gene order (collinearity) in a genomic segment, and it is often used to study how genomic rearrangements have shaped genomes during the course of evolution. However, accurate detection of syntenic blocks is highly dependent on parameters such as minimum number of anchors, and maximum number of upstream and downstream genes to search for syntenic blocks. Zhao and Schranz (2019) proposed a network-based synteny analysis (algorithm now implemented in the Bioconductor package syntenet) that allows the identification of optimal parameters using the network’s average clustering coefficient and number of nodes. Here, we slightly modified the approach to also take into account how well the network’s degree distribution fits a scale-free topology, which is a typical property of biological networks. This method allows users to identify the best combination of parameters for synteny detection and synteny network inference.

2 Installation

To install the package from Bioconductor, use the following code:

if(!requireNamespace('BiocManager', quietly = TRUE))
  install.packages('BiocManager')
BiocManager::install("cogeqc")

Loading the package after installtion:

# Load package after installation
library(cogeqc)
set.seed(123) # for reproducibility

3 Data description

Here, we will use a subset of the synteny network inferred in Zhao and Schranz (2019) that contains the synteny network for Brassica oleraceae, B. napus, and B. rapa.

# Load synteny network for 
data(synnet)

head(synnet)
#>             anchor1        anchor2
#> 1 bnp_BnaA01g05780D bol_Bo1g011310
#> 2 bnp_BnaA01g05800D bol_Bo1g011320
#> 3 bnp_BnaA01g05810D bol_Bo1g011330
#> 4 bnp_BnaA01g05820D bol_Bo1g011340
#> 5 bnp_BnaA01g05830D bol_Bo1g011350
#> 6 bnp_BnaA01g05840D bol_Bo1g011360

4 Network-based assessment of synteny identification

To assess synteny detection, we calculate a synteny network score as follows:

\[ \begin{aligned} Score &= C N R^2_{SFT} \end{aligned} \]

where \(C\) is the network’s clustering coefficient, \(N\) is the number of nodes, and \(R^2_{SFT}\) is the coefficient of determination for the scale-free topology fit.

The network with the highest score is considered the most accurate. To score a network, you will use the function assess_synnet().

assess_synnet(synnet)
#>         CC Node_count  Rsquared    Score
#> 1 0.877912     149144 0.6806854 89125.76

Ideally, you should infer synteny networks using syntenet with multiple combinations of parameters and assess each network to pick the best. To demonstrate it, let’s simulate different networks through resampling and calculate scores for each of them with the wrapper function assess_synnet_list().

# Simulate networks
net1 <- synnet
net2 <- synnet[-sample(1:10000, 500), ]
net3 <- synnet[-sample(1:10000, 1000), ]
synnet_list <- list(
  net1 = net1, 
  net2 = net2, 
  net3 = net3
)

# Assess original network + 2 simulations
synnet_assesment <- assess_synnet_list(synnet_list)
synnet_assesment
#>          CC Node_count  Rsquared    Score Network
#> 1 0.8779120     149144 0.6806854 89125.76    net1
#> 2 0.8769428     149133 0.6813367 89105.97    net2
#> 3 0.8758974     149114 0.6810978 88957.20    net3

# Determine the best network
synnet_assesment$Network[which.max(synnet_assesment$Score)]
#> [1] "net1"

As you can see, the first (original) network is the best, as it has the highest score.

Session information

This document was created under the following conditions:

sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.3.2 Patched (2023-11-13 r85521)
#>  os       Ubuntu 22.04.3 LTS
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language (EN)
#>  collate  C
#>  ctype    en_US.UTF-8
#>  tz       America/New_York
#>  date     2024-01-14
#>  pandoc   2.7.3 @ /usr/bin/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package          * version   date (UTC) lib source
#>  ape                5.7-1     2023-03-13 [2] CRAN (R 4.3.2)
#>  aplot              0.2.2     2023-10-06 [2] CRAN (R 4.3.2)
#>  beeswarm           0.4.0     2021-06-01 [2] CRAN (R 4.3.2)
#>  BiocGenerics       0.48.1    2024-01-14 [2] Bioconductor 3.18 (R 4.3.2)
#>  BiocManager        1.30.22   2023-08-08 [2] CRAN (R 4.3.2)
#>  BiocStyle        * 2.30.0    2024-01-14 [2] Bioconductor 3.18 (R 4.3.2)
#>  Biostrings         2.70.1    2024-01-14 [2] Bioconductor 3.18 (R 4.3.2)
#>  bitops             1.0-7     2021-04-24 [2] CRAN (R 4.3.2)
#>  bookdown           0.37      2023-12-01 [2] CRAN (R 4.3.2)
#>  bslib              0.6.1     2023-11-28 [2] CRAN (R 4.3.2)
#>  cachem             1.0.8     2023-05-01 [2] CRAN (R 4.3.2)
#>  cli                3.6.2     2023-12-11 [2] CRAN (R 4.3.2)
#>  cogeqc           * 1.6.2     2024-01-14 [1] Bioconductor 3.18 (R 4.3.2)
#>  colorspace         2.1-0     2023-01-23 [2] CRAN (R 4.3.2)
#>  crayon             1.5.2     2022-09-29 [2] CRAN (R 4.3.2)
#>  digest             0.6.34    2024-01-11 [2] CRAN (R 4.3.2)
#>  dplyr              1.1.4     2023-11-17 [2] CRAN (R 4.3.2)
#>  evaluate           0.23      2023-11-01 [2] CRAN (R 4.3.2)
#>  fansi              1.0.6     2023-12-08 [2] CRAN (R 4.3.2)
#>  farver             2.1.1     2022-07-06 [2] CRAN (R 4.3.2)
#>  fastmap            1.1.1     2023-02-24 [2] CRAN (R 4.3.2)
#>  fs                 1.6.3     2023-07-20 [2] CRAN (R 4.3.2)
#>  generics           0.1.3     2022-07-05 [2] CRAN (R 4.3.2)
#>  GenomeInfoDb       1.38.5    2024-01-14 [2] Bioconductor 3.18 (R 4.3.2)
#>  GenomeInfoDbData   1.2.11    2023-11-14 [2] Bioconductor
#>  ggbeeswarm         0.7.2     2023-04-29 [2] CRAN (R 4.3.2)
#>  ggfun              0.1.3     2023-09-15 [2] CRAN (R 4.3.2)
#>  ggplot2            3.4.4     2023-10-12 [2] CRAN (R 4.3.2)
#>  ggplotify          0.1.2     2023-08-09 [2] CRAN (R 4.3.2)
#>  ggtree             3.10.0    2024-01-14 [2] Bioconductor 3.18 (R 4.3.2)
#>  glue               1.7.0     2024-01-09 [2] CRAN (R 4.3.2)
#>  gridGraphics       0.5-1     2020-12-13 [2] CRAN (R 4.3.2)
#>  gtable             0.3.4     2023-08-21 [2] CRAN (R 4.3.2)
#>  highr              0.10      2022-12-22 [2] CRAN (R 4.3.2)
#>  htmltools          0.5.7     2023-11-03 [2] CRAN (R 4.3.2)
#>  igraph             1.6.0     2023-12-11 [2] CRAN (R 4.3.2)
#>  IRanges            2.36.0    2024-01-14 [2] Bioconductor 3.18 (R 4.3.2)
#>  jquerylib          0.1.4     2021-04-26 [2] CRAN (R 4.3.2)
#>  jsonlite           1.8.8     2023-12-04 [2] CRAN (R 4.3.2)
#>  knitr              1.45      2023-10-30 [2] CRAN (R 4.3.2)
#>  labeling           0.4.3     2023-08-29 [2] CRAN (R 4.3.2)
#>  lattice            0.22-5    2023-10-24 [3] CRAN (R 4.3.2)
#>  lazyeval           0.2.2     2019-03-15 [2] CRAN (R 4.3.2)
#>  lifecycle          1.0.4     2023-11-07 [2] CRAN (R 4.3.2)
#>  magrittr           2.0.3     2022-03-30 [2] CRAN (R 4.3.2)
#>  memoise            2.0.1     2021-11-26 [2] CRAN (R 4.3.2)
#>  munsell            0.5.0     2018-06-12 [2] CRAN (R 4.3.2)
#>  nlme               3.1-164   2023-11-27 [3] CRAN (R 4.3.2)
#>  patchwork          1.2.0     2024-01-08 [2] CRAN (R 4.3.2)
#>  pillar             1.9.0     2023-03-22 [2] CRAN (R 4.3.2)
#>  pkgconfig          2.0.3     2019-09-22 [2] CRAN (R 4.3.2)
#>  plyr               1.8.9     2023-10-02 [2] CRAN (R 4.3.2)
#>  purrr              1.0.2     2023-08-10 [2] CRAN (R 4.3.2)
#>  R6                 2.5.1     2021-08-19 [2] CRAN (R 4.3.2)
#>  Rcpp               1.0.12    2024-01-09 [2] CRAN (R 4.3.2)
#>  RCurl              1.98-1.14 2024-01-09 [2] CRAN (R 4.3.2)
#>  reshape2           1.4.4     2020-04-09 [2] CRAN (R 4.3.2)
#>  rlang              1.1.3     2024-01-10 [2] CRAN (R 4.3.2)
#>  rmarkdown          2.25      2023-09-18 [2] CRAN (R 4.3.2)
#>  S4Vectors          0.40.2    2024-01-14 [2] Bioconductor 3.18 (R 4.3.2)
#>  sass               0.4.8     2023-12-06 [2] CRAN (R 4.3.2)
#>  scales             1.3.0     2023-11-28 [2] CRAN (R 4.3.2)
#>  sessioninfo        1.2.2     2021-12-06 [2] CRAN (R 4.3.2)
#>  stringi            1.8.3     2023-12-11 [2] CRAN (R 4.3.2)
#>  stringr            1.5.1     2023-11-14 [2] CRAN (R 4.3.2)
#>  tibble             3.2.1     2023-03-20 [2] CRAN (R 4.3.2)
#>  tidyr              1.3.0     2023-01-24 [2] CRAN (R 4.3.2)
#>  tidyselect         1.2.0     2022-10-10 [2] CRAN (R 4.3.2)
#>  tidytree           0.4.6     2023-12-12 [2] CRAN (R 4.3.2)
#>  treeio             1.26.0    2024-01-14 [2] Bioconductor 3.18 (R 4.3.2)
#>  utf8               1.2.4     2023-10-22 [2] CRAN (R 4.3.2)
#>  vctrs              0.6.5     2023-12-01 [2] CRAN (R 4.3.2)
#>  vipor              0.4.7     2023-12-18 [2] CRAN (R 4.3.2)
#>  withr              2.5.2     2023-10-30 [2] CRAN (R 4.3.2)
#>  xfun               0.41      2023-11-01 [2] CRAN (R 4.3.2)
#>  XVector            0.42.0    2024-01-14 [2] Bioconductor 3.18 (R 4.3.2)
#>  yaml               2.3.8     2023-12-11 [2] CRAN (R 4.3.2)
#>  yulab.utils        0.1.3     2024-01-08 [2] CRAN (R 4.3.2)
#>  zlibbioc           1.48.0    2024-01-14 [2] Bioconductor 3.18 (R 4.3.2)
#> 
#>  [1] /tmp/RtmpOuJPhk/Rinst158aa1552aa7ee
#>  [2] /home/biocbuild/bbs-3.18-bioc/R/site-library
#>  [3] /home/biocbuild/bbs-3.18-bioc/R/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────

References

Zhao, Tao, and M Eric Schranz. 2019. “Network-Based Microsynteny Analysis Identifies Major Differences and Genomic Outliers in Mammalian and Angiosperm Genomes.” Proceedings of the National Academy of Sciences 116 (6): 2165–74.