From e772f1988601f0e48ff682a829c830f5c6ddead8 Mon Sep 17 00:00:00 2001 From: simonleandergrimm Date: Wed, 11 Oct 2023 15:43:44 -0400 Subject: [PATCH 1/3] changed logic of hatch_zero_counts. --- plot_summaries.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plot_summaries.py b/plot_summaries.py index 5bbab4c..c030e16 100755 --- a/plot_summaries.py +++ b/plot_summaries.py @@ -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) @@ -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]) @@ -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 From a9f9abd4523d4e955984353d6247d4071838163d Mon Sep 17 00:00:00 2001 From: simonleandergrimm Date: Fri, 10 Nov 2023 19:05:41 -0500 Subject: [PATCH 2/3] added mypy inline comments and fixed tuple mypy issue --- plot_summaries.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plot_summaries.py b/plot_summaries.py index 5bbab4c..1bcd7f0 100755 --- a/plot_summaries.py +++ b/plot_summaries.py @@ -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( @@ -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 @@ -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 @@ -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 From 00ae1606bdb131d0cb05ed419983913f47a84e2c Mon Sep 17 00:00:00 2001 From: simonleandergrimm Date: Fri, 17 Nov 2023 11:25:02 -0500 Subject: [PATCH 3/3] dropped estimates of AAV5. --- pathogens/aav5.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pathogens/aav5.py b/pathogens/aav5.py index cc4edd9..784c248 100644 --- a/pathogens/aav5.py +++ b/pathogens/aav5.py @@ -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]: