An R package for evaluation of pair-wise synteny conservation at the genome-wide scale. It takes a table of orthologs and genome annotation files formatted as BED to automatically infer significantly conserved linkage groups, and order them on an Oxford grid using a network based greedy algorithm.

License: GPL v3 CRAN bioRxiv:10.1101/2023.01.26.525673


# A stable version is available on CRAN and can be downloaded using :
# get the development version from GitHub using devtools :
# install.packages("devtools")
devtools::install_github("SamiLhll/macrosyntR",build_vignettes = TRUE)
# building the vignette makes the installation a bit longer but its mandatory so ou can access it by doing :   


Check out the vignette for a comprehensive step-by-step tutorial illustrating how the package works using publicly available data, and how to customize the analysis.

Preparing input data :

To start drawing an oxford grid using this package, you’ll need three files :
* 1 - A two columns table of orthologous pairs of genes between species to compare (as generated by rbhxpress)
* 2 - A bed file listing the genomic coordinates and sequence names of all the orthologs of the 1st species (with names matching the first column of file 1)
* 3 - A bed file, same as the other, for the 2nd species. (with names matching those of the first column of file 2)

Get an automatically ordered and colored Oxford grid :

To illustrate the results of the package we compare the publicly available data from the lancelet Branchiostoma floridae (Simakov et al. 2020) with the Siboglinidae Paraescarpia echinospica (Sun et al. 2021)
Once you have your pairs of orthologs, getting an ordered Oxford grid using this package is achieved as following :


# Load table of orthologs and integrate with genomic coordinates :
my_orthologs <- load_orthologs(orthologs_table = "DATA/",
                               sp1_bed = "DATA/Bfloridae.protein_products.bed",
                               sp2_bed = "DATA/Pechinospica.protein_products.bed")

# Draw an oxford grid :
p1 <- plot_oxford_grid(my_orthologs,
                       sp1_label = "B.floridae",
                       sp2_label = "P.echinospica")

# Automatically reorder the Oxford grid and color the detected clusters (communities):
p2 <- plot_oxford_grid(my_orthologs,
                       sp1_label = "B.floridae",
                       sp2_label = "P.echinospica",
                       reorder = TRUE,
                       color_by = "clust")

# Plot the significant linkage groups :
my_macrosynteny <- compute_macrosynteny(my_orthologs)
p3 <- plot_macrosynteny(my_macrosynteny)

# Call the reordering function, test significance and plot it :
my_orthologs_reordered <- reorder_macrosynteny(my_orthologs)
my_macrosynteny <- compute_macrosynteny(my_orthologs_reordered)
p4 <- plot_macrosynteny(my_macrosynteny)

Getting help

Need help, Identified a bug, or want to see other features implemented ?
Feel free to open an issue here or send an email at :


If used in your research, please cite :