Skip to content

Commit

Permalink
--no_ntbiases option for Circos plots
Browse files Browse the repository at this point in the history
  • Loading branch information
Pombert-JF committed Apr 29, 2024
1 parent c147eb4 commit e90b61b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
19 changes: 15 additions & 4 deletions Plots/nucleotide_biases.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/perl
## Pombert Lab, 2022
my $name = 'nucleotide_biases.pl';
my $version = '0.7a';
my $version = '0.7b';
my $updated = '2024-04-29';

use strict;
Expand Down Expand Up @@ -57,6 +57,7 @@
-max_points_per_track Set max number of points per track [Default: 75000]
-zdepth Set links zdepth in ruleset [Default: 50]
-clusters Color by clusters [Default: off]
-no_biases Skip nucleotide bias subplots in Circos configuration files
OPTIONS
die "\n$usage\n" unless @ARGV;

Expand All @@ -83,6 +84,7 @@
my $max_points_per_track = 75000;
my $zdepth = 50;
my $clusters;
my $no_biases;
GetOptions(
'f|fasta=s@{1,}' => \@fasta,
'o|outdir=s' => \$outdir,
Expand All @@ -106,7 +108,8 @@
'max_links=i' => \$max_links,
'max_points_per_track=i' => \$max_points_per_track,
'zdepth=i' => \$zdepth,
'clusters' => \$clusters
'clusters' => \$clusters,
'no_biases' => \$no_biases
);

### List presets and stop
Expand Down Expand Up @@ -704,12 +707,19 @@ sub print_circos_conf {
}
print $cg 'chromosomes_units='.$unit_width."\n\n";



## Biases plots
my $r_start = 0.99;
my $r_end = 0.95;

if ($no_biases){
goto LINKS;
}

print $cg '<plots>'."\n";
print $cg '################# BIASES'."\n\n";

my $r_start = 0.99;
my $r_end = 0.95;
my $modulo_counter = 0;

for my $bias (@biases) {
Expand Down Expand Up @@ -739,6 +749,7 @@ sub print_circos_conf {

print $cg '</plots>'."\n\n";

LINKS:
unless ($link_status eq 'nolink'){

my $link_start = $r_end + 0.04;
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ Options for run_SYNY.pl are:
--max_links Set max number of links [Default: 25000]
--max_points_per_track Set max number of points per track [Default: 75000]
--clusters Color by cluster instead of contig/chromosome [Default: off]
--no_ntbiases Turn off nucleotide biases subplots
--no_cticks Turn off ticks in Circos plots
--no_circos Turn off Circos plots
Expand Down Expand Up @@ -547,11 +548,15 @@ Karyotypes can be plotted with Circos in normal and/or inverted orientation(s).
<img src="https://github.com/PombertLab/SYNY/blob/main/Images/WM276_vs_JEC21.gap_0.normal.png">
</p>

In this figure, nucleotides biases are plotted in the concentric rings (from outer to inner rings):
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:

- AT and GC nucleotide biases (grey and red lines)
- GT and AC nucleotide biases (blue and green lines)
- GA and CT nucleotide biases (purple and yellow lines)




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 arabic and roman numerals in the Circos plots. Contigs from the reference (query) are labelled by roman numerals; others are labelled by arabic numerals. If desired, contigs can instead be labelled by their names with the `--labels names` command line option. Label sizes (default: 36) and fonts can be further adjusted with the `--label_size` and `--label_font` command line options. Possible fonts are: `light`,
Expand Down
11 changes: 10 additions & 1 deletion run_syny.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Pombert lab, 2022

my $name = 'run_syny.pl';
my $version = '0.6.4f';
my $version = '0.6.5';
my $updated = '2024-04-29';

use strict;
Expand Down Expand Up @@ -71,6 +71,7 @@
--max_links Set max number of links [Default: 25000]
--max_points_per_track Set max number of points per track [Default: 75000]
--clusters Color by cluster instead of contig/chromosome [Default: off]
--no_ntbiases Turn off nucleotide biases subplots
--no_cticks Turn off ticks in Circos plots
--no_circos Turn off Circos plots
Expand Down Expand Up @@ -137,6 +138,7 @@
my $max_points_per_track = 75000;
my $clusters;
my $circos_orientation = 'normal';
my $no_ntbiases;
my $no_circos;
my $no_cticks;

Expand Down Expand Up @@ -198,6 +200,7 @@
'max_points_per_track=i' => \$max_points_per_track,
'clusters' => \$clusters,
'orientation=s' => \$circos_orientation,
'no_ntbiases' => \$no_ntbiases,
'no_circos' => \$no_circos,
'no_cticks' => \$no_cticks,
# Barplots
Expand Down Expand Up @@ -1079,6 +1082,11 @@
$circos_ticks_flag = '--noticks';
}

my $circos_ntbiases_flag = '';
if ($no_ntbiases){
$circos_ntbiases_flag = '--no_biases';
}

my $gap = $gaps[0];

## Running nucleotide_biases.pl
Expand All @@ -1101,6 +1109,7 @@
--max_points_per_track $max_points_per_track \\
$cluster_flag \\
$circos_ticks_flag \\
$circos_ntbiases_flag \\
2>> $log_err
") == 0 or checksig();

Expand Down

0 comments on commit e90b61b

Please sign in to comment.