-
Notifications
You must be signed in to change notification settings - Fork 51
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
Refactor eigdecomp phasing and sorting #397
base: master
Are you sure you want to change the base?
Conversation
@@ -171,7 +171,6 @@ def eigs_cis( | |||
clr_weight_name=clr_weight_name, | |||
ignore_diags=ignore_diags, | |||
clip_percentile=99.9, | |||
sort_metric=None, | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this desired? this issue suggests to expose sort_metric
#311
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it to be replaced with corr_metric
(used for both flipping and reordering) and reorder
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha, gotcha-- thoughts on phasing_metric
or phasing_corr_metric
to help remind the user what this is for?
|
||
# Go through eigendecomposition results and fill in output tables. | ||
for _region, _eigvals, _eigvecs in results: | ||
idx = bioframe.select(eigvec_table, _region).index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't there a duplication?
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- imho it'd be nice to align cis and trans function a bit - to minimize confusion
- cli argument regarding sorting/phasing needs to be sorted out
other than that seems to be a useful refactoring !
|
||
# Go through eigendecomposition results and fill in output tables. | ||
for _region, _eigvals, _eigvecs in results: | ||
idx = bioframe.select(eigvec_table, _region).index |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
few tweaks and reorderings in eigdecomp to address my comments in open2c#397
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
submitted suggested changes nvictus#2
Some work to modularize various sub-operations in eigdecomp.
Decouple target matrix preparation from decomposition. Might make it easier to provide different target matrix options (e.g. balanced vs unbalanced O/E, mean-centered vs 1-centered, fake-cis vs other approach).
Decouple deterministic sign flipping (providing
phasing_track
) and reordering/sorting (reorder=True
). Both options will make use ofcorr_metric
if activated, which defaults topearsonr
.