Skip to content

Commit

Permalink
cleanup before API change
Browse files Browse the repository at this point in the history
  • Loading branch information
shitohana committed Sep 23, 2023
1 parent 6e42081 commit 9517cfb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
13 changes: 6 additions & 7 deletions src/bismarkplot/Bismark.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,10 @@ def __init__(
self.genome = genome
self.bismark = read_bismark_batches(file, genome, flank_windows, gene_windows, batch_size, cpu)

self.__flank_windows = flank_windows
self.__gene_windows = gene_windows

self.__line_plot = None
self.__heat_map = None
self.__bar_plot = None
self.__box_plot = None
self.__flank_windows, self.__gene_windows = flank_windows, gene_windows
self.__line_plot, self.__heat_map, self.__bar_plot, self.__box_plot = [None]*4

@property
def line_plot(self) -> LinePlot:
"""
Getter for line plot. Calculates data once after first call.
Expand All @@ -52,6 +48,7 @@ def line_plot(self) -> LinePlot:
self.__line_plot = LinePlot(self.bismark)
return self.__line_plot

@property
def heat_map(self) -> HeatMap:
"""
Getter for heat map. Calculates data once after first call.
Expand All @@ -60,6 +57,7 @@ def heat_map(self) -> HeatMap:
self.__heat_map = HeatMap(self.bismark)
return self.__heat_map

@property
def box_plot(self) -> BoxPlot:
"""
Getter for box plot. Calculates data once after first call.
Expand All @@ -68,6 +66,7 @@ def box_plot(self) -> BoxPlot:
self.__box_plot = BoxPlot(self.bismark)
return self.__box_plot

@property
def bar_plot(self) -> BarPlot:
"""
Getter for bar plot. Calculates data once after first call.
Expand Down
11 changes: 6 additions & 5 deletions src/bismarkplot/BismarkFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os

import matplotlib.axes
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
Expand Down Expand Up @@ -82,13 +83,13 @@ def __init__(

bismark = Bismark(file, genome, flank_windows, gene_windows, batch_size, cpu)
if line_plot:
self.line_plots.append(bismark.line_plot())
self.line_plots.append(bismark.line_plot)
if heat_map:
self.heat_maps.append(bismark.heat_map())
self.heat_maps.append(bismark.heat_map)
if bar_plot:
self.bar_plots.append(bismark.bar_plot())
self.bar_plots.append(bismark.bar_plot)
if box_plot:
self.box_plots.append(bismark.box_plot())
self.box_plots.append(bismark.box_plot)
if store_res:
self.bismarks.append(bismark)

Expand Down Expand Up @@ -202,7 +203,7 @@ def draw_heat_maps_filtered(
image = ax.imshow(
im_data, interpolation="nearest", aspect='auto', cmap=colormaps['cividis'], vmin=vmin, vmax=vmax
)

assert isinstance(ax, matplotlib.axes.Axes)
ax.set(title=labels[number])
ax.set_xlabel('Position')
ax.set_ylabel('')
Expand Down

0 comments on commit 9517cfb

Please sign in to comment.