Skip to content

Commit

Permalink
fixed bug with newer release of matplotlib (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-fuchs authored Oct 12, 2023
1 parent 8119219 commit 87b9c52
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
5 changes: 1 addition & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
matplotlib>=3.5.1
numpy>=1.23.3
vcfpy>=0.13.6
pandas>=1.4.4
.
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
Expand Down
2 changes: 1 addition & 1 deletion virheat/__init__.py
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion virheat/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions virheat/scripts/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand All @@ -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)

Expand Down

0 comments on commit 87b9c52

Please sign in to comment.