Skip to content

updating pattern clustering#140

Merged
nkempynck merged 10 commits intomainfrom
dev
Mar 28, 2026
Merged

updating pattern clustering#140
nkempynck merged 10 commits intomainfrom
dev

Conversation

@nkempynck
Copy link
Copy Markdown
Collaborator

Updating pattern clustering in the standard enhancer code analysis.

Faster tomtoms: not one vs one but one vs collection
Dual direction tomtom calculation
Updated default thresholds

To do: update notebook

@nkempynck
Copy link
Copy Markdown
Collaborator Author

still WIP

@nkempynck
Copy link
Copy Markdown
Collaborator Author

New feature: x_shift parameter for contribution scores plotting
Added an x_shift parameter to contribution_scores() in src/crested/pl/explain/_contribution_scores.py that allows shifting the viewing window left or right when zooming into specific subsets of a region. Includes bounds checking with a clear error message.

Bug fix: duplicate kwargs in clustermap_tf_motif
Fixed a bug in src/crested/pl/modisco/_modisco.py where aspect, cmap, and norm were passed both as explicit arguments and through **imshow_kws, causing a TypeError. All defaults are now handled through the imshow_kws dict. Also added a cbar_pad parameter for controlling colorbar positioning, and improved colorbar rendering with manual positioning, a custom light-centered colormap, and better label padding.

Modisco pattern matching improvements (_tfmodisco.py)

Changed default sim_threshold from 0.5 to 7.0 in match_to_patterns() and from 3.0 to 6.0 in process_patterns().
Changed default trim_ic_threshold from 0.05 to 0.025 in process_patterns().
Vectorized the pattern matching logic in match_to_patterns() using matrix operations instead of a loop, taking the element-wise maximum of both comparison orders to handle asymmetric similarity scores.
Added a new post_hoc_merging() function that iteratively merges similar patterns above a similarity threshold, with IC-based filtering and optional verbose output. The old implementation is preserved as post_hoc_merging_old().
Added a return_info parameter to post_hoc_merging() to optionally return merge metadata.

@nkempynck
Copy link
Copy Markdown
Collaborator Author

Also enhancer_code_analysis update

@nkempynck
Copy link
Copy Markdown
Collaborator Author

notebook that is

@nkempynck nkempynck merged commit 25c0f9f into main Mar 28, 2026
11 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.

1 participant