Skip to content

Commit

Permalink
Merge branch 'simon-drop-aav5' into simon-comp-fig-4
Browse files Browse the repository at this point in the history
  • Loading branch information
simonleandergrimm committed Nov 17, 2023
2 parents b36aa09 + 00ae160 commit 944f226
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
12 changes: 4 additions & 8 deletions pathogens/aav5.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,10 @@ def estimate_prevalences() -> list[Prevalence]:
date_source=Variable(date="2018"),
location_source=Variable(country="Denmark"),
)
return [
us_2020,
us_2021,
dk_2015,
dk_2016,
dk_2017,
dk_2018,
]
return []
# Dropped, because of zero counts across all studies; lends little
# additonal information to the preprint (and complicates explantion
# of how we selected viruses.)


def estimate_incidences() -> list[IncidenceRate]:
Expand Down
18 changes: 9 additions & 9 deletions plot_summaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def plot_violin(
y: str,
sorting_order: list[str],
ascending: list[bool],
hatch_zero_counts: bool = False,
hatch_zero_counts: bool = True,
violin_scale=1.0,
) -> None:
assert len(sorting_order) == len(ascending)
Expand Down Expand Up @@ -114,7 +114,7 @@ def plot_violin(
path.vertices[:, 1] = (
violin_scale * (path.vertices[:, 1] - y_mid) + y_mid
)
if (not hatch_zero_counts) and (num_reads == 0):
if (hatch_zero_counts) and (num_reads == 0):
color = patches.get_facecolor()
y_max = np.max(path.vertices[:, 1])
y_min = np.min(path.vertices[:, 1])
Expand Down Expand Up @@ -166,7 +166,7 @@ def plot_incidence(data: pd.DataFrame, input_data: pd.DataFrame) -> plt.Figure:
ascending=[False, True, False, True, False],
violin_scale=2.0,
)
ax.set_xlim([-13, -3])
ax.set_xlim(-13.0, -3.0)
separate_viruses(ax)
adjust_axes(ax, predictor_type=predictor_type)
legend = ax.legend(
Expand All @@ -176,8 +176,8 @@ def plot_incidence(data: pd.DataFrame, input_data: pd.DataFrame) -> plt.Figure:
borderaxespad=0,
frameon=False,
)
for legend_handle in legend.legend_handles:
legend_handle.set_edgecolor(legend_handle.get_facecolor())
for legend_handle in legend.legend_handles: # type: ignore
legend_handle.set_edgecolor(legend_handle.get_facecolor()) # type: ignore
return fig


Expand Down Expand Up @@ -207,7 +207,7 @@ def plot_prevalence(
ascending=[False, True, False, True, False],
violin_scale=1.5,
)
ax.set_xlim([-15, -7])
ax.set_xlim(-15, -7)
ax.set_xticks(list(range(-15, -5, 2)))
separate_viruses(ax)
# TODO Get these values automatically
Expand Down Expand Up @@ -239,8 +239,8 @@ def plot_prevalence(
borderaxespad=0,
frameon=False,
)
for legend_handle in legend.legend_handles:
legend_handle.set_edgecolor(legend_handle.get_facecolor())
for legend_handle in legend.legend_handles: # type: ignore
legend_handle.set_edgecolor(legend_handle.get_facecolor()) # type: ignore
return fig


Expand All @@ -265,7 +265,7 @@ def plot_three_virus(
sorting_order=["study", "location"],
ascending=[False, True],
violin_scale=2.5,
hatch_zero_counts=True,
hatch_zero_counts=False,
)
ax.set_xlim(xlim)
# TODO Get these values automatically
Expand Down

0 comments on commit 944f226

Please sign in to comment.