The SYNY pipeline investigates gene collinearity (synteny) between genomes by reconstructing clusters from conserved pairs of protein-coding genes identified from DIAMOND homology searches. It also infers collinearity from pairwise genome alignments with minimap2 or MashMap3.
Below is a quick example describing how to compare a few select Cryptococcus genomes (C. neoformans var. neoformans strain JEC21, C. gattii strain WM276, C. gattii VGV strain MF34, C. decagattii strain 7685027, C. deuterogattii strain R265) using annotation data available from the public NCBI Genome database.
Downloading Cryptococcus example data automatically from NCBI using the provided Cryptococcus.sh shell script from the Examples/
subdirectory:
DATA=~/DATA ## Replace ~/DATA by desired annotation data directory
Cryptococcus.sh $DATA
Or downloading the Cryptococcus data manually instead:
DATA=~/DATA ## Replace ~/DATA by desired annotation data directory
mkdir -p $DATA
##### Downloading data from NCBI ####
BASEURL=https://ftp.ncbi.nlm.nih.gov/genomes/all
### Cryptococcus neoformans strain JEC21
outfile=${DATA}/JEC21.gbff.gz
printf "\nDownloading Cryptococcus neoformans strain JEC21 as ${outfile}\n\n"
curl \
-L ${BASEURL}/GCF/000/091/045/GCF_000091045.1_ASM9104v1/GCF_000091045.1_ASM9104v1_genomic.gbff.gz \
-o $outfile
### Cryptococcus gattii strain WM276
outfile=${DATA}/WM276.gbff.gz
printf "\nDownloading Cryptococcus neoformans strain JEC21 as ${outfile}\n\n"
curl \
-L ${BASEURL}/GCF/000/185/945/GCF_000185945.1_ASM18594v1/GCF_000185945.1_ASM18594v1_genomic.gbff.gz \
-o $outfile
### Cryptococcus gattii VGV strain MF34
outfile=${DATA}/MF34.gbff.gz
printf "\nDownloading Cryptococcus gattii VGV strain MF34 as ${outfile}\n\n"
curl \
-L ${BASEURL}/GCA/009/650/685/GCA_009650685.1_Cryp_gatt_MF34/GCA_009650685.1_Cryp_gatt_MF34_genomic.gbff.gz \
-o $outfile
### Cryptococcus decagattii strain 7685027
outfile=${DATA}/D7685.gbff.gz
printf "\nDownloading Cryptococcus decagattii strain 7685027 as ${outfile}\n\n"
curl \
-L ${BASEURL}/GCA/036/417/295/GCA_036417295.1_ASM3641729v1/GCA_036417295.1_ASM3641729v1_genomic.gbff.gz \
-o $outfile
### Cryptococcus deuterogattii strain R265
outfile=${DATA}/R265.gbff.gz
printf "\nDownloading Cryptococcus deuterogattii strain R265 as ${outfile}\n\n"
curl \
-L ${BASEURL}/GCF/002/954/075/GCF_002954075.1_C._deuterogattii_R265_chr/GCF_002954075.1_C._deuterogattii_R265_chr_genomic.gbff.gz \
-o $outfile
SYNY can be run from the command line with the run_syny.pl
master script. In the command line below, no gap is allowed during gene cluster inferences, and Circos plots are produced in pairwise mode. The latter can be changed with the --circos
command line switch (possible values are: pair
, concatenated
, all
). Note that when comparing several genomes, concatenated plots can quickly become too dense for legibility. Producing concatenated plots can also significantly increase computation time.
##### Runtime (Intel i5-12500H mobile CPU)
# Total: 16 min; Circos: 11 min
DATA=~/DATA ## Replace by annotation data directory
SYNY=~/SYNY_RESULTS/CRYPT_ALL ## Replace by desired output directory
run_syny.pl \
--threads 16 \
--annot $DATA/*.gbff.gz \
--outdir $SYNY
In the command line below, SYNY is run on a subset of two genomes (JEC21
and WM276
), this time allowing for different maximum gap thresholds between gene pairs.
##### Runtime (Intel i5-12500H mobile CPU)
# Total: 2 min; Circos: 1 min)
DATA=~/DATA ## Replace by annotation data directory
SYNY=~/SYNY_RESULTS/CRYPT_SUB ## Replace by desired output directory
run_syny.pl \
-t 16 \
-a $DATA/{JEC21,WM276}.gbff.gz \
-o $SYNY \
-g 0 1 5 \
-e 1e-10
head -n 32 $SYNY/CLUSTERS/SYNTENY/clusters_summary.tsv
##### JEC21_vs_WM276; Gap = 0 #####
Total number of proteins in clusters: 5760
# of clusters: 779
Longest: 64
Shortest: 2
Average cluster size: 7
Median cluster size: 5
N50: 10
N75: 6
N90: 4
##### JEC21_vs_WM276; Gap = 1 #####
Total number of proteins in clusters: 5921
# of clusters: 228
Longest: 204
Shortest: 2
Average cluster size: 26
Median cluster size: 15
N50: 53
N75: 26
N90: 13
##### JEC21_vs_WM276; Gap = 5 #####
Total number of proteins in clusters: 5956
# of clusters: 53
Longest: 434
Shortest: 2
Average cluster size: 112
Median cluster size: 58
N50: 237
N75: 163
N90: 66
head -n 22 $SYNY/CLUSTERS/SYNTENY/gap_0/CLUSTERS/JEC21_vs_WM276.clusters
### Cluster 0001; CNA00020 to CNA00070; CGB_B0020C to CGB_B0070W; size = 6 ###
CNA00020 - CGB_B0020C -
CNA00030 + CGB_B0030W +
CNA00040 - CGB_B0040C -
CNA00050 + CGB_B0050W +
CNA00060 - CGB_B0060C -
CNA00070 + CGB_B0070W +
### Cluster 0002; CNA00080 to CNA00150; CGB_B0080W to CGB_B0150C; size = 8 ###
CNA00080 + CGB_B0080W +
CNA00090 + CGB_B0090W +
CNA00100 - CGB_B0100C -
CNA00110 + CGB_B0110W +
CNA00120 - CGB_B0120C -
CNA00130 + CGB_B0130W +
CNA00140 - CGB_B0140C -
CNA00150 - CGB_B0150C -
### Cluster 0003; CNA00180 to CNA00220; CGB_B0180C to CGB_B0220W; size = 5 ###
CNA00180 - CGB_B0180C -
CNA00190 - CGB_B0190C -
CNA00200 + CGB_B0200W +
CNA00210 - CGB_B0210C -
CNA00220 + CGB_B0220W +
Overall cluster metrics are summarized in CLUSTERS/SYNTENY/clusters_summary_table.tsv
.
head -n 7 $SYNY/CLUSTERS/SYNTENY/clusters_summary_table.tsv
### Query Total # proteins Allowed Gaps Total # proteins in clusters % of proteins in clusters # of clusters Longest Shortest Average Median N50 N75 N90
JEC21_vs_WM276 6863 0 5762 83.96 779 64 2 7 5 10 6 4
JEC21_vs_WM276 6863 1 5922 86.29 228 204 2 26 15 53 26 13
JEC21_vs_WM276 6863 5 5957 86.80 53 434 2 112 58 237 163 66
WM276_vs_JEC21 6565 0 5760 87.74 778 64 2 7 5 10 6 4
WM276_vs_JEC21 6565 1 5923 90.22 229 204 2 26 15 53 26 13
WM276_vs_JEC21 6565 5 5957 90.74 51 477 2 117 56 260 164 66
To facilitate comparisons when working with large datasets, heatmaps summarizing the percentages of collinear bases in pairwise genome alignments (.mmap.
) and the percentages of protein coding-genes found in collinear clusters between each pair of genomes (e.g. .gap_0.
) are generated with matplotlib.
In the above example, small heatmaps with 25 datapoints (5 5 genomes) will be generated for the minimap2 pairwise alignments and for the protein clusters found for each gap value investigated. In these heatmaps, percentages between pairs of genomes will vary based on the total number of bases and proteins found in the query used: i.e. `(collinear bases / total bases in query) 100and
(proteins in clusters / total proteins in query) * 100`.
Heatmap dimensions (default: 10 x 10) can be modified with the --hheight
and --hwidth
command line switches. Color bar min/max values (defaults: 0/100) can be changed with the --hmin
and --hmax
command line switches or calculated automatically with --hauto
. The heatmap color palette (default: winter_r) can be changed with the --hmpalette
command line switch (see this URL for a list of color palettes). Color palettes available on the operating system can be listed and/or plotted with check_mp_colors.py.
Unless the --no_circos
command line switch is invoked, Circos (pairwise and/or concatenated) will be generated from the protein clusters identified with SYNY (e.g. .gap_0.
) and/or from the genome alignments computed with minimap2 or MashMap3 (.mmap.
).
In the pairwise plots (--circos pair
), genomes are plotted in pairs (query vs. subject) using the query as the reference. In the concatenated plots (--circos cat
), all genomes are plotted together in a single figure, using the reference genome specified with the --ref
command line switch. If omitted, the first genome encountered alphabetically will be used as the default reference. Both concatenated and pairwise plots can be generated with the --circos all
command line switch.
Karyotypes can be plotted with Circos in normal and/or inverted orientation(s). In the inverted plots, the contigs/chromosomes from the genome(s) being compared to the reference are plotted in reverse, from last to first. By default, the Circos plots are plotted in normal orientation. This behavior can be modified with the --orientation
command line switch (possible values are normal
, inverted
and both
).
In this figure, nucleotides biases are plotted in the concentric rings. These subplots can be skipped with the --no_ntbiases
command line switch. From from outer to inner, the concentric rings are:
Syntenic blocks identified by SYNY are indicated by ribbons. These ribbons are color-coded based on the chromosomes/contigs present in the reference genome used. If desired, color coding can be set by cluster instead with --clusters
. This option is useful when working with prokaryotes featuring a single chromosome, so that the ribbons are not all of the same color.
By default, contigs will be labelled by mixed numerals (roman + arabic) in the Circos plots. Contigs from the reference (query) will be labelled by roman
numerals, others by arabic
numerals. This behavior can be changed with the --labels
command line option. Possible values are mixed
, roman
, arabic
and names
. Using --labels roman
or --labels arabic
will set all label numbers to the corresponding format, whereas using --labels names
will label contigs by their names instead. Label sizes (default: 36) and fonts can be further adjusted with the --label_size
and --label_font
command line options. Possible fonts are: light
,
normal
, default
, semibold
, bold
, italic
, bolditalic
, italicbold
(see this Circos tutorial for details).
##### Runtime (Intel i5-12500H mobile CPU)
# Total: 2 min; Circos: 1 min
DATA=~/DATA ## Replace by annotation data directory
SYNY=~/SYNY_RESULTS/CRYPT_SUB_NAMES ## Replace by desired output directory
run_syny.pl \
-a $DATA/{JEC21,WM276}.gbff.gz \
-g 0 1 5 \
-e 1e-10 \
-r JEC21 \
-o $SYNY \
--circos all \
--circos_prefix WM276_vs_JEC21 \
--labels names \
--label_size 20 \
--label_font semibold
All data and configuration files for the Circos plots are in the PLOTS/CIRCOS_DATA/
subdirectory. If desired, chromosome labels can be further adjusted manually by editing the LABEL
column in the corresponding Circos karyotype file(s). Karyotype files created by SYNY (in PLOTS/CIRCOS_DATA/
) ends with *.karyotype
.
## To see the first 5 lines from a karyotype file:
head -n 5 concatenated.normal.karyotype
#chr - ID LABEL START END COLOR
chr - NC_014938 1 0 1984822 black
chr - NC_014939 2 0 2187694 black
chr - NC_014940 3 0 1961511 black
chr - NC_014941 4 0 2233617 black
Once edited, Circos plots can be regenerated by running Circos on the corresponding configuration files, e.g.:
SYNY=~/SYNY_RESULTS/CRYPT_SUB_NAMES ## Replace by SYNY results directory
OUTDIR=~/PLOTS ## Replace by desired output directory
circos \
-conf $SYNY/PLOTS/CIRCOS_DATA/concatenated/concatenated.gap_0.normal.conf \
-outputdir $OUTDIR \
-outputfile circos.gap_0.normal.png
In the inverted karyotype image, the order of the karyotype(s) to be compared to the reference one is reversed. This option can be useful when comparing genomes whose chromosomes have been assigned similar numbers based on various inference methods (this does not appear to be the case in the above example). In such instances, inverting the karyotypes can help improve figure legibility.
In pairwise genome alignments, repetitive regions (such as telomeres/subtelomeres) can produce more than one alignment for a given locus. In the above figure, a bit of extra noise is added to the figure (as thin criss-crossing lines) due to these repetitive segments. As a rule of thumb, repetitive segments are easier to spot in dotplot-like figures (see Dotplots section below).
Chromosome maps (aka barplots) highlighting collinear genome segments will be generated with paf_to_barplot.py and matplotlib from minimap2/mashmap3 pairwise genome alignments (.mmap.
) and from protein clusters identified with SYNY (e.g. .gap_0.
).
In these plots, collinear regions found between the compared genomes are highlighted by colored rectangles. By default, these rectangles are color-coded based on the contigs/chromosomes of the query. The above barplot image was generated using the Spectral color palette from seaborn (set as default in SYNY). This palette can be replaced using the --palette
command line switch; e.g. --palette husl
(see this URL for a list of color palettes). Color palettes available on the operating system can be listed and/or plotted with check_mp_colors.py.
If desired, the barplots can instead be generated using a single monochromatic color with the --monobar
command line switch; e.g. --monobar red
. If this option is selected, the color-coding legend will be omitted from the plot.
By default, the barplots are formatted for a widescreen (landscape) output (width/height ratio: 19.2/10.8). This ratio can be adjusted with the --bheight
and --bwidth
command line switches.
By default, SYNY generates pairwise barplots. If desired, concatenated barplots can also be generated. In these concatenated barplots, the contigs from all species queried against a species (the reference) are plotted together. This behaviour can be changed with the --bpmode
option. Possible values are pair
(pairwise; set as default), cat
(concatenated), and all
(cat + pair).
Linear chromosome maps (aka linemaps) highlighting collinear genome segments will be generated with linear_maps.py and matplotlib from pairwise genome alignments (.mmap.
) and from protein clusters identified with SYNY (e.g. .gap_0.
). In these plots, collinear regions found between the compared genomes are highlighted by colored polygons. By default, these polygons are color-coded based on the contigs/chromosomes of the reference. The above linemap image was generated using the tab20/Blues color palettes for the reference/target genomes (both set as defaults in SYNY). These palettes can be replaced using the --lm_rpalette
and --lm_xpalette
command line switches; e.g. --lm_xpalette Grays
(see URL for a list of color palettes). By default, the linemaps are formatted using a 20:5 width:height ratio. This ratio can be adjusted with the --lheight
and --lwidth
command line switches.
Unless the --no_dotplot
command line switch is invoked, dotplots will be generated with paf_to_dotplot.py and matplotlib from pairwise genome alignments (.mmap.
) and from protein clusters identified with SYNY, (e.g. .gap_0.
).
In these dotplots, each chromosome/contig from the query is plotted as a column (x-axis) against each chromosome/contig from the subject (y-axis). In the above example, a total of 196 subplots (14 x 14 chromosomes) are plotted using matplotlib's subplot function. In these plots, matches are plotted using the selected color (defaut: blue), with repeated loci indicated by the presence of matches across two or more contigs/chromosomes.
Because large numbers quickly overlap in the small subplots, to improve legibility, numbers in the x and y axes are scaled down using a desired scale with the --multi
command line switch (default: 1e5). For example:
1e3: n x 1000 bp
1e4: n x 10000 bp
1e5: n x 100000 bp
1e6: n x 1000000 bp
Alternatively, ticks/numbers in the x and y axes can be turned off with the --noticks
command line option.
By default, the dotplots are formatted for a widescreen (landscape) output (width/height ratio: 19.2/10.8). This ratio can be adjusted with the --dheight
and --dwidth
command line switches.
The default monochromatic color (blue) can be changed with the --color
option (e.g. --color red
). If desired, dotplots can instead be color-coded based on the query contigs/chromosomes with the --dotpalette
option; e.g. --dotpalette husl
(see this URL for a list of color palettes). Color palettes available on the operating system can be listed and/or plotted with check_mp_colors.py.
##### Runtime (Intel i5-12500H mobile CPU);
# Total: < 1 min; Circos: N/A
DATA=~/DATA ## Replace by annotation data directory
SYNY=~/SYNY_RESULTS/CRYPT_HUSL ## Replace by desired output directory
## Running SYNY with the husl color palette (for dotplots)
## and the --no_circos option to skip Circos plotting
run_syny.pl \
-a $DATA/{JEC21,WM276}.gbff.gz \
-g 0 1 5 \
-e 1e-10 \
-o $SYNY \
--dotpalette husl \
--no_circos
When computing pairwise genome alignments with minimap2, PAF metrics will also be calculated independently to help assess the outcome of these alignments. These metrics are available in the ALIGNMENTS/METRICS/
subdirectory, with alignment length vs. sequence similarity (%) scatter plots available in PNG format.
In the above plot, the average sequence identity for each alignment is calculated from the PAF files as follows:
$(\#\ of\ residue\ matches / Alignment\ block\ length) * 100$
Likewise, the total average sequence identity percentage listed in the PAF metrics insert is calculated by dividing the sum of all residue matches by the sum of all aligned block lengths.
As a rule of thumb, pairwise alignments featuring lower sequence identity percentages will produce fewer and/or more fragmented collinear segments.
PAF metrics cannot be calculated for MashMap3 aligments since the data required is missing from its PAF output files. MashMap3 does not calculate alignments explicitly (as per its intructional manual) but runs in a much smaller memory footprint than minimap2 when using its default percentage identity (--mpid 85
). As such, it constitutes an interesting alternative when running into memory constraints. However, note that lowering the MashMap3 default threshold will significantly increase its memory usage.
Below is a quick example describing how to compare a few select genomes from the Encephalitozoonidae (Encephalitozoon/Ordospora species E. intestinalis strain ATCC 50506, E. hellem strain ATCC 50604, E. cuniculi strain ATCC 50602, O. colligata strain OC4 and O. pajunii strain FI-F-10) using annotation data from NCBI.
The Encephalitozoonidae genomes in this example are highly collinear yet display a high level of sequence divergence. As such, they constitute a good case scenario to assess the benefits of using gene clusters to complement inferences based on pairwise genome alignments.
Downloading genome data automatically from NCBI using the Encephalitozoonidae.sh shell script from the Examples/
subdirectory:
DATA=~/ENCE ## Replace ~/ENCE by desired annotation data directory
Encephalitozoonidae.sh $DATA
Or downloading the Encephalitozoonidae data manually instead:
DATA=~/ENCE ## Replace ~/ENCE by desired annotation data directory
mkdir -p $DATA
##### Downloading data from NCBI ####
BASEURL=https://ftp.ncbi.nlm.nih.gov/genomes/all
## Encephalitozoon intestinalis ATCC 50506 telomere-to-telomere (T2T) genome
outfile=${DATA}/Ei50506.gbff.gz
printf "\nDownloading Encephalitozoon intestinalis ATCC 50506 as ${outfile}\n\n"
curl \
-L ${BASEURL}/GCA/024/399/295/GCA_024399295.1_ASM2439929v1/GCA_024399295.1_ASM2439929v1_genomic.gbff.gz \
-o $outfile
## Encephalitozoon hellem ATCC 50604 telomere-to-telomere (T2T) genome
outfile=${DATA}/Eh50604.gbff.gz
printf "\nDownloading Encephalitozoon hellem ATCC 50604 as ${outfile}\n\n"
curl \
-L ${BASEURL}/GCA/024/399/255/GCA_024399255.1_ASM2439925v1/GCA_024399255.1_ASM2439925v1_genomic.gbff.gz \
-o $outfile
## Encephalitozoon cuniculi ATCC 50602 telomere-to-telomere (T2T) genome
outfile=${DATA}/Ec50602.gbff.gz
printf "\nDownloading Encephalitozoon cuniculi ATCC 50602 as ${outfile}\n\n"
curl \
-L ${BASEURL}/GCA/027/571/585/GCA_027571585.1_ASM2757158v1/GCA_027571585.1_ASM2757158v1_genomic.gbff.gz \
-o $outfile
## Ordospora colligata OC4
outfile=${DATA}/OcOC4.gbff.gz
printf "\nDownloading Ordospora colligata OC4 as ${outfile}\n\n"
curl \
-L ${BASEURL}/GCF/000/803/265/GCF_000803265.1_ASM80326v1/GCF_000803265.1_ASM80326v1_genomic.gbff.gz \
-o $outfile
## Ordospora pajunii FI-F-10
outfile=${DATA}/OpFIF10.gbff.gz
printf "\nDownloading Ordospora pajunii FI-F-10 as ${outfile}\n\n"
curl \
-L ${BASEURL}/GCF/021/821/965/GCF_021821965.1_FI-F-10_v._1/GCF_021821965.1_FI-F-10_v._1_genomic.gbff.gz \
-o $outfile
To reduce runtime, we will skip the Circos plots with the --no_circos
option.
##### Runtime (Intel i5-12500H mobile CPU);
# Total: 1 min; Circos: N/A
DATA=~/ENCE ## Replace by annotation data directory
SYNY=~/SYNY_RESULTS/ENCE ## Replace by desired output directory
run_syny.pl \
-a $DATA/*.gbff.gz \
-g 0 \
-e 1e-10 \
-o $SYNY \
--no_circos
Here, while the pairwise alignments and gene cluster collinear inferences produce similar results within species (not shown), they differ substantially between species. For example, below are two barplots between Encephalitozoon hellem and Ordospora colligata. While the results are congruent, gene clusters inferences .gap_0.
perform better than those based on pairwise alignments (.mmap.
), the latter of which struggle due to the high levels of sequence divergence involved. These differences will also be reflected in the dotplots, heatmaps and Circos plots generated (not shown)
When working with genomes exhibiting a high level of divergence, both minimap2 and MashMap3 may fail to produce decent alignments. If that happens, we recommend using MashMap3 with a minimum percentage identity set lower than its default 85% threshold (e.g. --mpid 70
). Note that doing so will increase its RAM usage and may introduce artefacts/noise in the plots produced.
Barplots (gene clusters):
Barplots (genome alignments; minimap2):
Barplots (genome alignments; mashmap; --mpid 85):
Barplots (genome alignments; mashmap; --mpid 70):
Because comparing more than two genomes can be useful, concatenated Circos plots can be generated by SYNY using the --circos all
or the--circos cat
command line switches. Below is a quick example of how to generate such plots using the genomes from the three Encephalitozoon species downloaded previously.
##### Runtime (Intel i5-12500H mobile CPU);
# Total: < 1 min; Circos: 17 sec
DATA=~/ENCE ## Replace by annotation data directory
SYNY=~/SYNY_RESULTS/SYNY_3_spp ## Replace by desired output directory
run_syny.pl \
-a $DATA/E*.gbff.gz \
-g 0 \
-e 1e-10 \
-r Ei50506 \
-o $SYNY \
--circos cat \
--circos_prefix encephalitozoon
In the above Circos plot, links between the reference and the queried genomes are color-coded based on the reference karyotype; links between the queried genomes are shown in light gray. In these plots, each chromosome/contig is plotted as a distinct ideogram.
Note that while SYNY can plot multiple genomes together with --circos cat
/ --circos all
, adding too much data can quickly clutter the concatenated Circos plots (drawing too many ideograms can make the figure illegible). If the concatenated plots are too dense, drawing pairwise plots with --circos pair
should help with readability. However, when comparing genomes featuring many chromosomes/contigs, cluttering can occur even in pairwise plots.
Custom colors for Circos plots can be loaded directly from tab-delimited text files containing color names and their associated RGB values (see custom_color_1.txt for an example). A few custom presets are also available to use in SYNY.
##### Runtime (Intel i5-12500H mobile CPU);
# Total: 1 min; Circos: 37 sec
DATA=~/ENCE ## Replace by annotation data directory
SYNY=~/SYNY_RESULTS/ENCE_CC ## Replace by desired output directory
COLORS=~/custom_color_2.txt ## Replace by desired custom color file
run_syny.pl \
-a $DATA/E*.gbff.gz \
-g 0 1 5 \
-e 1e-10 \
-r Ei50506 \
-o $SYNY \
--custom_file $COLORS \
--circos all \
--circos_prefix encephalitozoon_cc
run_syny.pl --list_preset
Available color presets:
blues 13 colors
chloropicon 20 colors
encephalitozoon 11 colors
##### Runtime (Intel i5-12500H mobile CPU);
# Total: 1 min; Circos: 37 sec
DATA=~/ENCE ## Replace by annotation data directory
SYNY=~/SYNY_RESULTS/ENCE_CC_PRESET ## Replace by desired output directory
run_syny.pl \
-a $DATA/E*.gbff.gz \
-g 0 1 5 \
-e 1e-10 \
-r Ei50506 \
-o $SYNY \
--circos all \
--circos_prefix encephalitozoon_blues \
--custom_preset blues
SYNY uses GenBank flat files (.gbff) containing DNA sequences and annotated features as input. However, when performing genome alignment-based comparisons, the latter annotated features are not required. Because users may want to compare genomes before their annotation becomes available (this process often comes in the late stages of genome sequencing projects), a simple FASTA to GBFF converter fasta_to_gbff.pl producing feature-less .gbff files is available in the Utils/
subdirectory.
To convert FASTA file(s) to feature-less GBFF files compressed in gzip format:
fasta_to_gbff.pl \
--fasta *.fasta.gz \
--outdir GBFF \
--gzip
Options for fasta_to_gbff.pl
are:
-f (--fasta) FASTA file(s) to convert (gziped files are supported)
-o (--outdir) Output directory [Default: GBFF]
-g (--gzip) Compress the GBFF output files
-v (--verbose) Add verbosity
When compressing the GBFF output files, fasta_to_gbff.pl
will use pigz
if available, otherwise it will default to gzip
.
Because large and/or fragmented genomes can be difficult to visualize due to plot density, SYNY also includes options to look at subsets of genomes. Contigs to be investigated/plotted can be specified from a single text file with the --include
command line switch, while portions of contigs can also be specified in a tab-delimited text file with the --ranges
command line switch. Alternatively, contigs can also be excluded using a regular expression with the --exclude
command line switch. The latter option is useful when dealing with accession numbers containing a mixture of complete chromosomes and partial contigs, the latter often indicated with distinctive names. These partial contigs are often small, numerous, and tend to clutter plots. As such, removing them is often desirable.
Below are example to plots portions from two Arabidopsis genomes (A. thaliana and A. arenosa). These genomes can be downloaded automatically using the Arabidopsis.sh shell script (from the Examples/
directory).
## Downloading example data from NCBI using the Arabidopsis.sh shell script
DATA=~/DATA ## Replace ~/DATA by desired annotation data directory
Arabidopsis.sh $DATA
To plot the full dataset:
##### Runtime (Intel i5-12500H mobile CPU)
# Total: 6 min; Circos: 4 min)
DATA=~/DATA ## Replace by annotation data directory
SYNY=~/SYNY_RESULTS/ARAB_ALL ## Replace by desired output directory
run_syny.pl \
--threads 16 \
--annot $DATA/*.gbff.gz \
--aligner mashmap \
--outdir $SYNY \
--g 0 1 5
In the corresponding plots, two small contigs (NC_000932 and NC_037304) are observed. These are organelle genomes (chloroplast + mitochondrion) sometimes present together with nuclear genomes in accesssion numbers.
To plot only the chromosomes originating from the nuclear genomes, we can specify them in a simple text file, then run SYNY with the --include
command line switch:
# Content of contigs.txt
NC_003070
NC_003071
NC_003074
NC_003075
NC_003076
LR999451
LR999452
LR999453
LR999454
LR999455
LR999456
LR999457
LR999458
##### Runtime (Intel i5-12500H mobile CPU)
# Total: 6 min; Circos: 4 min)
DATA=~/DATA ## Replace by annotation data directory
SYNY=~/SYNY_RESULTS/ARAB_INC ## Replace by desired output directory
run_syny.pl \
--threads 16 \
--annot $DATA/*.gbff.gz \
--aligner mashmap \
--outdir $SYNY \
--g 0 1 5 \
--include contigs.txt
If desired we can also plot only segments from specified contigs/chromosomes. These segments can be specified in a simple (tab/space)-delimited text file, then run SYNY with the --ranges
command line switch:
# Content of subranges.txt
# Contig start end
NC_003070 1 1000000
NC_003070 1500000 2500000
NC_003070 3000000 4000000
NC_003071 1 19698289
LR999451 1 25224288
LR999452 1 14316399
LR999453 1 21694789
##### Runtime (Intel i5-12500H mobile CPU)
# Total: 1 min; Circos: 30 sec)
DATA=~/DATA ## Replace by annotation data directory
SYNY=~/SYNY_RESULTS/ARAB_SUB ## Replace by desired output directory
run_syny.pl \
--threads 16 \
--annot $DATA/*.gbff.gz \
--aligner mashmap \
--outdir $SYNY \
--g 0 1 5 \
--ranges subranges.txt
In the above example, numbers will be appended to contig names whenever approriate to differentiate between multiple segments, i.e. NC_003070_1, NC_003070_2 and NC_003070_3 (see below).