Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/cooler/cli/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ def get_matrix_size(c, row_region, col_region):
return ncols * nrows


def load_matrix(c, row_region, col_region, field, balanced, scale):
def load_matrix(c, row_region, col_region, field, balanced, scale, weights):
if balanced and weights != 'weight':
balanced = weights

mat = c.matrix(balance=balanced, field=field).fetch(row_region, col_region)

if scale == "log2":
Expand Down Expand Up @@ -177,8 +180,11 @@ def update_heatmap(event):
@click.option(
"--field", default="count", show_default=True, help="Pixel values to display."
)
@click.option(
"--weights", default="weight", show_default=True, help="weight column to use when --balanced = True"
)
def show(
cool_uri, range, range2, balanced, out, dpi, scale, force, zmin, zmax, cmap, field
cool_uri, range, range2, balanced, out, dpi, scale, force, zmin, zmax, cmap, field, weights
):
"""
Display and browse a cooler in matplotlib.
Expand Down Expand Up @@ -222,7 +228,7 @@ def show(
plt.get_current_fig_manager().set_window_title("Contact matrix")
plt.title("")
plt.imshow(
load_matrix(c, row_region, col_region, field, balanced, scale),
load_matrix(c, row_region, col_region, field, balanced, scale, weights),
interpolation="none",
extent=[col_lo, col_hi, row_hi, row_lo],
vmin=zmin,
Expand Down
Loading