Skip to content

Commit

Permalink
Used the same kwargs method as in the CNV function
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbrenas committed Aug 29, 2024
1 parent 3a3ab7b commit 699c1ab
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
18 changes: 14 additions & 4 deletions malariagen_data/anoph/g123.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ def plot_g123_gwss_track(
sizing_mode: gplt_params.sizing_mode = gplt_params.sizing_mode_default,
width: gplt_params.width = gplt_params.width_default,
height: gplt_params.height = 200,
circle_kwargs: Optional[gplt_params.circle_kwargs] = None,
show: gplt_params.show = True,
x_range: Optional[gplt_params.x_range] = None,
output_backend: gplt_params.output_backend = gplt_params.output_backend_default,
Expand Down Expand Up @@ -375,15 +376,22 @@ def plot_g123_gwss_track(
output_backend=output_backend,
)

circle_kwargs_mutable = dict(circle_kwargs) if circle_kwargs else {}
circle_kwargs_mutable["size"] = circle_kwargs_mutable.get("size", 3)
circle_kwargs_mutable["line_width"] = circle_kwargs_mutable.get("line_width", 1)
circle_kwargs_mutable["line_color"] = circle_kwargs_mutable.get(
"line_color", "black"
)
circle_kwargs_mutable["fill_color"] = circle_kwargs_mutable.get(
"fill_color", None
)

# plot G123
fig.scatter(
x=x,
y=g123,
size=3,
marker="circle",
line_width=1,
line_color="black",
fill_color=None,
**circle_kwargs_mutable,
)

# tidy up the plot
Expand Down Expand Up @@ -420,6 +428,7 @@ def plot_g123_gwss(
sizing_mode: gplt_params.sizing_mode = gplt_params.sizing_mode_default,
width: gplt_params.width = gplt_params.width_default,
track_height: gplt_params.track_height = 170,
circle_kwargs: Optional[gplt_params.circle_kwargs] = None,
genes_height: gplt_params.genes_height = gplt_params.genes_height_default,
show: gplt_params.show = True,
output_backend: gplt_params.output_backend = gplt_params.output_backend_default,
Expand All @@ -441,6 +450,7 @@ def plot_g123_gwss(
sizing_mode=sizing_mode,
width=width,
height=track_height,
circle_kwargs=circle_kwargs,
show=False,
output_backend=output_backend,
inline_array=inline_array,
Expand Down
18 changes: 14 additions & 4 deletions malariagen_data/anoph/h12.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def plot_h12_gwss_track(
sizing_mode: gplt_params.sizing_mode = gplt_params.sizing_mode_default,
width: gplt_params.width = gplt_params.width_default,
height: gplt_params.height = 200,
circle_kwargs: Optional[gplt_params.circle_kwargs] = None,
show: gplt_params.show = True,
x_range: Optional[gplt_params.x_range] = None,
output_backend: gplt_params.output_backend = gplt_params.output_backend_default,
Expand Down Expand Up @@ -377,15 +378,22 @@ def plot_h12_gwss_track(
output_backend=output_backend,
)

circle_kwargs_mutable = dict(circle_kwargs) if circle_kwargs else {}
circle_kwargs_mutable["size"] = circle_kwargs_mutable.get("size", 3)
circle_kwargs_mutable["line_width"] = circle_kwargs_mutable.get("line_width", 1)
circle_kwargs_mutable["line_color"] = circle_kwargs_mutable.get(
"line_color", "black"
)
circle_kwargs_mutable["fill_color"] = circle_kwargs_mutable.get(
"fill_color", None
)

# Plot H12.
fig.scatter(
x=x,
y=h12,
marker="circle",
size=3,
line_width=1,
line_color="black",
fill_color=None,
**circle_kwargs_mutable,
)

# Tidy up the plot.
Expand Down Expand Up @@ -422,6 +430,7 @@ def plot_h12_gwss(
sizing_mode: gplt_params.sizing_mode = gplt_params.sizing_mode_default,
width: gplt_params.width = gplt_params.width_default,
track_height: gplt_params.track_height = 170,
circle_kwargs: Optional[gplt_params.circle_kwargs] = None,
genes_height: gplt_params.genes_height = gplt_params.genes_height_default,
show: gplt_params.show = True,
output_backend: gplt_params.output_backend = gplt_params.output_backend_default,
Expand All @@ -441,6 +450,7 @@ def plot_h12_gwss(
sizing_mode=sizing_mode,
width=width,
height=track_height,
circle_kwargs=circle_kwargs,
show=False,
output_backend=output_backend,
)
Expand Down
18 changes: 14 additions & 4 deletions malariagen_data/anoph/h1x.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def plot_h1x_gwss_track(
sizing_mode: gplt_params.sizing_mode = gplt_params.sizing_mode_default,
width: gplt_params.width = gplt_params.width_default,
height: gplt_params.height = 200,
circle_kwargs: Optional[gplt_params.circle_kwargs] = None,
show: gplt_params.show = True,
x_range: Optional[gplt_params.x_range] = None,
output_backend: gplt_params.output_backend = gplt_params.output_backend_default,
Expand Down Expand Up @@ -219,15 +220,22 @@ def plot_h1x_gwss_track(
output_backend=output_backend,
)

circle_kwargs_mutable = dict(circle_kwargs) if circle_kwargs else {}
circle_kwargs_mutable["size"] = circle_kwargs_mutable.get("size", 3)
circle_kwargs_mutable["line_width"] = circle_kwargs_mutable.get("line_width", 1)
circle_kwargs_mutable["line_color"] = circle_kwargs_mutable.get(
"line_color", "black"
)
circle_kwargs_mutable["fill_color"] = circle_kwargs_mutable.get(
"fill_color", None
)

# Plot H1X.
fig.scatter(
x=x,
y=h1x,
marker="circle",
size=3,
line_width=1,
line_color="black",
fill_color=None,
**circle_kwargs_mutable,
)

# Tidy up the plot.
Expand Down Expand Up @@ -268,6 +276,7 @@ def plot_h1x_gwss(
sizing_mode: gplt_params.sizing_mode = gplt_params.sizing_mode_default,
width: gplt_params.width = gplt_params.width_default,
track_height: gplt_params.track_height = 190,
circle_kwargs: Optional[gplt_params.circle_kwargs] = None,
genes_height: gplt_params.genes_height = gplt_params.genes_height_default,
show: gplt_params.show = True,
output_backend: gplt_params.output_backend = gplt_params.output_backend_default,
Expand All @@ -288,6 +297,7 @@ def plot_h1x_gwss(
sizing_mode=sizing_mode,
width=width,
height=track_height,
circle_kwargs=circle_kwargs,
show=False,
output_backend=output_backend,
)
Expand Down

0 comments on commit 699c1ab

Please sign in to comment.