Skip to content

Adding a new metric BRAS(Batch Removal Adapted Silhouette) #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 23, 2025

Conversation

seohyonkim
Copy link
Contributor

Describe your changes

This PR is for implementing a new metric, BRAS.

Checklist before requesting a review

  • I have performed a self-review of my code

  • Check the correct box. Does this PR contain:

    • Breaking changes
    • New functionality
    • Major changes
    • Minor changes
    • Bug fixes
  • Proposed changes are described in the CHANGELOG.md

  • CI Tests succeed and look good!

@seohyonkim seohyonkim marked this pull request as draft June 4, 2025 17:22
@prauten
Copy link

prauten commented Jun 5, 2025

Hi there,

This is Pia, the first author of the publication introducing BRAS writing. What a coincidence! I was just reviewing the contribution guidelines for OpenProblems and came across your (@seohyonkim) pull request implementing the metric. It's wonderful to see its adoption!

I wanted to let you know that in addition to the basic BRAS implementation included in the reproducibility notebook you are using, there is now a scalable implementation available as part of the latest release of the scib-metrics package: https://github.com/YosefLab/scib-metrics. I don't know how large the benchmark datasets are in the batch integration task, but it might be worth considering the scib-metrics implementation.

Let me know if you have any questions!

Best,
Pia

P.S.: Thanks to all maintainers and contributors for this valuable community effort!

@seohyonkim
Copy link
Contributor Author

Hello @prauten ! Thanks for checkout out this PR and leaving a comment. And also leaving the link to the newer version of the BRAS! I'd love to implement the newer one, do the original metric and the newer version reproduce the same results?

@prauten
Copy link

prauten commented Jun 6, 2025

Hi @seohyonkim, my pleasure! And yes, I verified the equivalence of the scalable implementation of BRAS with the naive implementation presented in the preprint (see https://github.com/YosefLab/scib-metrics/blob/12b6f354ac0305c8c81859696ed57f7e3c75927c/tests/test_BRAS_metric.py).

Copy link
Collaborator

@mumichae mumichae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Removing the boilerplate code would be preferable

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove the boilerplate comments for better readability?

The BRAS (Batch Removal Adapted Silhouette) metric modifies the standard silhouette score to account for batch effects in single-cell data integration benchmarking.
Instead of measuring how well a cell matches its biological label cluster compared to other clusters (as in regular silhouette), BRAS compares how well it matches its biological cluster in its own batch versus the same biological cluster in other batches.
For each cells, BRAS computes the ai = average distance to cells with the same label in the same batch, and bi = the average distance to cells with the same label in different batches.
It then uses ai and bi for the standard silhoueette formula.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

@mumichae mumichae marked this pull request as ready for review July 22, 2025 14:20
@mumichae mumichae merged commit ab0064c into openproblems-bio:main Jul 23, 2025
2 checks passed
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.

3 participants