Skip to content

Conversation

@niekwit
Copy link

@niekwit niekwit commented Feb 3, 2025

Hello,

Thank you for this amazing tool!

I don't know whether you saw that I created a pull request for your bagel repository (hart-lab/bagel#35), but I have made the same alterations for DrugZ in this pull request.

Also, with later Pandas versions there were a lot of FutureWarnings, like this one:

/home/niek/mambaforge/envs/drugz/lib/python3.13/site-packages/drugz.py:191: FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
A typical example is when you are setting values in a column of a DataFrame, like:

df["col"][row_indexer] = value

Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

  fold_change[empirical_bayes_id][no_of_guides - half_window_size:] = results

I have adapted the code to what was suggested by the warnings as well.

I hope you find this useful and please do let me know if you would like me to make any further changes.

Best wishes,

Niek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant