From 87b9c52bbd781eb74a59a788ab39633796cfbea0 Mon Sep 17 00:00:00 2001 From: Jonas Fuchs <78491186+jonas-fuchs@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:47:12 +0200 Subject: [PATCH] fixed bug with newer release of matplotlib (#8) --- requirements.txt | 5 +---- setup.py | 5 +++-- virheat/__init__.py | 2 +- virheat/command.py | 2 +- virheat/scripts/plotting.py | 4 ++-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/requirements.txt b/requirements.txt index 561dfc1..945c9b4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1 @@ -matplotlib>=3.5.1 -numpy>=1.23.3 -vcfpy>=0.13.6 -pandas>=1.4.4 \ No newline at end of file +. \ No newline at end of file diff --git a/setup.py b/setup.py index 2a1d45b..ba1278d 100644 --- a/setup.py +++ b/setup.py @@ -15,10 +15,11 @@ license_files=('LICENSE'), packages=find_packages(), install_requires=[ - "matplotlib>=3.5.1", + "matplotlib>=3.5.1,<=3.8.0", "numpy>=1.23.3", + "pandas>=1.4.4" ], - description='virHEAT creates a heatmap from vcf files and maps positions onto a reference genome.', + description='virHEAT creates a heatmap from vcf files and maps positions on to a reference genome.', url='https://github.com/jonas-fuchs/virHEAT', author='Dr. Jonas Fuchs', author_email='jonas.fuchs@uniklinik-freiburg.de', diff --git a/virheat/__init__.py b/virheat/__init__.py index 7c4a9a3..e841665 100644 --- a/virheat/__init__.py +++ b/virheat/__init__.py @@ -1,3 +1,3 @@ """plot vcf data as a heatmap mapped to a virus genome""" _program = "virheat" -__version__ = "0.5.1" +__version__ = "0.5.2" diff --git a/virheat/command.py b/virheat/command.py index 3e0eb58..963f4cc 100644 --- a/virheat/command.py +++ b/virheat/command.py @@ -165,7 +165,7 @@ def main(sysargs=sys.argv[1:]): # plot gene track plotting.create_gene_vis(ax, genes_with_mutations, n_mutations, y_size, n_tracks, genome_end, min_y_location, genome_y_location, colors_genes) plotting.create_axis(ax, n_mutations, min_y_location, n_samples, file_names, genome_end, genome_y_location, unique_mutations, reference_name) - plotting.create_colorbar(args.threshold, cmap_cells, min_y_location, n_samples) + plotting.create_colorbar(args.threshold, cmap_cells, min_y_location, n_samples, ax) plotting.create_mutation_legend(mutation_set, min_y_location, n_samples) # create output folder diff --git a/virheat/scripts/plotting.py b/virheat/scripts/plotting.py index 2b172fb..7819eda 100644 --- a/virheat/scripts/plotting.py +++ b/virheat/scripts/plotting.py @@ -66,7 +66,7 @@ def create_genome_vis(ax, genome_y_location, n_mutations, unique_mutations, geno return mutation_set -def create_colorbar(threshold, cmap, min_y_location, n_samples): +def create_colorbar(threshold, cmap, min_y_location, n_samples, ax): """ creates a custom colorbar and annotates the threshold """ @@ -90,7 +90,7 @@ def create_colorbar(threshold, cmap, min_y_location, n_samples): labels.remove(rounded_threshold) ticks.append(threshold) labels.append(f"threshold\n={threshold}") - cbar = plt.colorbar(cmap, label="variant frequency", pad=0, shrink=n_samples/(min_y_location+n_samples), anchor=(0.1, 1), aspect=15) + cbar = plt.colorbar(cmap, label="variant frequency", pad=0, shrink=n_samples/(min_y_location+n_samples), anchor=(0.1,1), aspect=15, ax=ax) cbar.set_ticks(ticks) cbar.set_ticklabels(labels)