Conversation
There was a problem hiding this comment.
Pull request overview
This PR prepares the netrics R package for release v1.0.1 by fixing cluster_cosine() so that clustering is performed over nodes (rows) rather than over motif/census features (columns), and by adding a regression test to prevent this from recurring.
Changes:
- Fixed
cluster_cosine()to compute cosine similarities on transposed motif input (t(motif)), aligning it with the other clustering methods’ node-profile orientation. - Added a regression test ensuring cosine-based clustering returns node-length memberships and node-sized distance matrices on a census with many features.
- Bumped package version to
1.0.1and documented the fix inNEWS.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
R/method_cluster.R |
Fixes cluster_cosine() to cluster nodes by transposing the motif before cosine similarity. |
tests/testthat/test-model_cluster.R |
Adds a regression test that would fail if cosine clustering is done over features instead of nodes. |
NEWS.md |
Adds 1.0.1 entry describing the cluster_cosine() fix. |
DESCRIPTION |
Updates package version to 1.0.1. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #30 +/- ##
==========================================
+ Coverage 88.62% 88.67% +0.05%
==========================================
Files 30 30
Lines 3533 3533
==========================================
+ Hits 3131 3133 +2
+ Misses 402 400 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Methods
cluster_cosine()to cluster nodes and not census features (thanks @Kaladani)