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
10 changes: 10 additions & 0 deletions malariagen_data/anoph/cnv_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,11 @@ def plot_cnv_hmm_coverage_track(
debug("remove data where HMM is not called")
data = data.query("call_CN >= 0")

if len(data) == 0:
raise ValueError(
f"No CNV HMM data found for sample {sample_id!r} in region {region_prepped!r}."
)

debug("set up y range")
if y_max == "auto":
y_max_float = data["call_CN"].max() + 2
Expand Down Expand Up @@ -930,6 +935,11 @@ def plot_cnv_hmm_heatmap_track(
end = ds_cnv["variant_end"].values
n_windows, n_samples = cn.shape

if n_windows == 0:
raise ValueError(
f"No CNV HMM data found for region {region_prepped!r}."
)

debug("figure out X axis limits from data")
x_min = start[0]
x_max = end[-1]
Expand Down