Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
axes_pc1_cov = self.fig.add_subplot(247)
axes_tetra_pc1_pc3 = self.fig.add_subplot(248)
axes_gc_coverage = self.fig.add_subplot(245)
axes_tetra_pc1_pc2 = self.fig.add_subplot(244)
else:
# note: the ordering here is specific and ensures
# proper linked brushing
axes_gc_dist = self.fig.add_subplot(231)
axes_tetra_dist = self.fig.add_subplot(234)
axes_deltaGC_td = self.fig.add_subplot(232)
axes_pc1_td = self.fig.add_subplot(235)
axes_tetra_pc1_pc2 = self.fig.add_subplot(233)
axes_tetra_pc1_pc3 = self.fig.add_subplot(236)
# create plots
gc_plots = GcPlots(self.options)
scatter, delta_gc, seq_len, label_plot_order = gc_plots.plot_on_axes(self.fig,
genome_scaffold_stats,
highlight_scaffold_ids,
link_scaffold_ids,
genome_stats.mean_gc,
gc_dist,
[gc_perc],
None,
axes_gc_dist,
True)
td_plots = TdPlots(self.options)
_scatter, td, _, _ = td_plots.plot_on_axes(self.fig,
genome_scaffold_stats,
highlight_scaffold_ids,
link_scaffold_ids,
# create subplots depending on availability of coverage information
if len(genome_stats.mean_coverage) >= 1:
axes_hist_GC = self.fig.add_subplot(321)
axes_scatter_GC = self.fig.add_subplot(322)
axes_hist_TD = self.fig.add_subplot(323)
axes_scatter_TD = self.fig.add_subplot(324)
axes_hist_cov_perc = self.fig.add_subplot(325)
axes_scatter_cov_perc = self.fig.add_subplot(326)
else:
axes_hist_GC = self.fig.add_subplot(221)
axes_scatter_GC = self.fig.add_subplot(222)
axes_hist_TD = self.fig.add_subplot(223)
axes_scatter_TD = self.fig.add_subplot(224)
gc_plots = GcPlots(self.options)
scatter, _, _, _ = gc_plots.plot_on_axes(self.fig,
genome_scaffold_stats,
highlight_scaffold_ids,
link_scaffold_ids,
genome_stats.mean_gc,
gc_dist,
[gc_perc],
axes_hist_GC,
axes_scatter_GC,
True)
td_plots = TdPlots(self.options)
td_plots.plot_on_axes(self.fig,
genome_scaffold_stats,
highlight_scaffold_ids,
link_scaffold_ids,
genomes_processed,
len(genome_stats),
genomes_processed * 100.0 / len(genome_stats)))
sys.stdout.flush()
genome_scaffold_stats = {}
for scaffold_id in scaffold_stats.scaffolds_in_genome[genome_id]:
genome_scaffold_stats[scaffold_id] = scaffold_stats.stats[scaffold_id]
if len(genome_scaffold_stats) <= 1:
self.logger.info('Skipping plots for {} as it contains only {:,} contigs.'.format(genome_id, len(genome_scaffold_stats)))
continue
if individual_plots:
# GC plot
gc_plots = GcPlots(plot_options)
gc_plots.plot(genome_scaffold_stats,
highlight_scaffolds_ids,
link_scaffold_ids,
gs.mean_gc,
gc_dist,
[plot_options.gc_perc])
output_plot = os.path.join(output_dir, genome_id + '.gc_plots.' + plot_options.image_type)
gc_plots.save_plot(output_plot, dpi=plot_options.dpi)
gc_plots.save_html(os.path.join(output_dir, genome_id + '.gc_plots.html'))
# TD plot
td_plots = TdPlots(plot_options)
td_plots.plot(genome_scaffold_stats,
highlight_scaffolds_ids,
link_scaffold_ids,