Skip to content

Commit

Permalink
Update Polars syntax in fragments_to_bigwig.py to 0.20.04+ version.
Browse files Browse the repository at this point in the history
Update Polars syntax in fragments_to_bigwig.py to 0.20.04+ version.
  • Loading branch information
ghuls committed Apr 24, 2024
1 parent 7c5be66 commit 6c1b626
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def read_bed_to_polars_df(

# Enable global string cache so categorical columns from multiple Polars DataFrames
# can be joined later, if necessary.
pl.enable_string_cache(True)
pl.enable_string_cache()

if engine == "polars":
# Read BED file with Polars.
Expand Down Expand Up @@ -234,7 +234,7 @@ def read_fragments_to_polars_df(
):
fragments_df_pl = fragments_df_pl.groupby(
["Chromosome", "Start", "End", "Name"]
).agg(pl.count().cast(pl.Int32()).alias("Score"))
).agg(pl.len().cast(pl.Int32()).alias("Score"))
else:
fragments_df_pl = fragments_df_pl.with_columns(pl.col("Score").cast(pl.Int32()))

Expand Down

0 comments on commit 6c1b626

Please sign in to comment.