From f4a7846e2429fac275a08c7aa6f0ff4c9d6d5d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ester=20Mu=C3=B1oz=20del=20Campo?= Date: Tue, 25 Jun 2024 15:09:03 +0200 Subject: [PATCH] Fix prints. --- src/pyranges_plot/data_preparation.py | 4 ++-- src/pyranges_plot/plotly_base/plot_exons_ply.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pyranges_plot/data_preparation.py b/src/pyranges_plot/data_preparation.py index 87e287d..47c383d 100644 --- a/src/pyranges_plot/data_preparation.py +++ b/src/pyranges_plot/data_preparation.py @@ -302,7 +302,7 @@ def get_genes_metadata(df, id_col, color_col, packed, exon_height, v_spacer): [CHROM_COL, PR_INDEX_COL], group_keys=False, observed=True ).apply(genesmd_packed) # add packed ycoord column genesmd_df.reset_index(level=CHROM_COL, inplace=True) - genesmd_df = genesmd_df.groupby(CHROM_COL).apply( + genesmd_df = genesmd_df.groupby(CHROM_COL, observed=True).apply( lambda x: update_y(x, exon_height, v_spacer) ) genesmd_df.drop(CHROM_COL, axis=1, inplace=True) @@ -481,7 +481,7 @@ def get_chromosome_metadata( ].max() ) chrmd_df.rename(columns={"ycoord": "pr_line"}, inplace=True) - chrmd_df["pr_line"] = chrmd_df.groupby(CHROM_COL)["pr_line"].shift( + chrmd_df["pr_line"] = chrmd_df.groupby(CHROM_COL, observed=True)["pr_line"].shift( -1, fill_value=-(0.5 + exon_height / 2 + v_spacer) ) diff --git a/src/pyranges_plot/plotly_base/plot_exons_ply.py b/src/pyranges_plot/plotly_base/plot_exons_ply.py index e85b527..84eb4bb 100644 --- a/src/pyranges_plot/plotly_base/plot_exons_ply.py +++ b/src/pyranges_plot/plotly_base/plot_exons_ply.py @@ -152,7 +152,6 @@ def plot_exons_ply( fig.data[0].customdata = np.array(["no warnings"]) if to_file is None: - print(fig["data"][0]["customdata"][0]) app_instance = initialize_dash_app(fig, max_shown) app_instance.run(port=plotly_port)