-
Notifications
You must be signed in to change notification settings - Fork 12
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
Adding sorting method #128
Adding sorting method #128
Conversation
…po in a unittest, edited gitignore/Rbuildignore
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.
Looks good, but should be in mia
Looks good overall but I added some comments to sync with the rest of the package |
See also: microbiome/OMA#146 |
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.
Looks good!
At this point, I would like to discuss about the TreeSE/SCE support.
For example mia::calculateJSD have support for both matrix and SE.
Similarly, this could support TreeSE. So in addition to this current implementation, there could be method for TreeSE which has parameters for selecting
- dimension reduction (dimred parameter)
- number of dimensions (ncomponents)
- whether to sort the output TreeSE (sort)
However, reducedDim slot requires that number of columns/samples match. If I understood correctly, this "neatsort" can be done also for features which means that reducedDim slot cannot be utilized (scater::calculatePCA and scater::calculateMDS can still be used as they have transposed parameter and they return only the output matrix). If that is the case, then I think that we should only support method for matrix to make things simpler.
Support for SE should be enough for methods that do not use the tree information. Because TreeSE is SE (it inherits SE). Currently we do not seem to have ordination methods that utilize the tree. Those exist I think but they are not commonly used. It is an interesting possibility but probably not very urgent.
Adding dimension reduction would mean that we combine the steps or ordination and sorting? Possible but at leas it would complicate the implementation because now the sorting can be done based on any ordination method output. If these are combined, we need to choose which ordination methods are supported. If I got this right. I am not sure if the radial theta angle methods is defined beyond the 2D case, hence ncomponents might not be valid option w.r.t. neatsort. Sorting can be also done afterwards, the added value might be limited.
Neatsort can be done for any Nx2 numeric matrix. Usually it is applied to sample scores is samples x PCaxes score matrix but in principle other uses are possible. TBH it might not be critical to support feature loading matrices (features x PCaxes) because this doesn't seem very common. But it is possible and potentially useful, and out current implementations seems to have that support because it can operate with arbitrary Nx2 matrices. Indeed, we could choose to simply support sample scores and use the reducedDim slot for that. This will complicate the implementation and the added value is not yet clear. I tend to think that we could keep getNearOrder support for matrices for now. If real use cases will call for a more streamlined implementation and TreeSE support we can always add that. But then we will need to address these more complex design questions. This is somewhat related to the question on how we should present feature loadings in general in TreeSE objects because reducedDim is indeed only supporting the sample scores, and missing the feature loadings. The metadata slot can be used for that at least. |
I meant that user could first do dimension reduction with methods that add the result to reducedDim and then call getNeatOrder(). As SE does not have reducedDim slot, at least SCE should have been supported. But I agree, that only matrix should be supported at this point. This would make the usage simple
|
Right, I agree: getNearOrder could support reducedDim (TreeSE/SCE). But perhaps best to think about that later since the cost/benefit ratio seems a bit open. |
Thanks both for the review and comments, I'm working on all of these updates today! |
So I have implemented the changes but I have a few follow up questions just before I push.
|
|
…ng-sorting-method Updating local to remote
Run BiocCheck::BiocCheck(). There were some NOTEs related to these lines. Resolve those notes that can reasonably do. (If line contains only URL address, you can keep that even though it exceeds 80 characters) |
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.
Looks good! Adding ComplexHeatmap to Suggests probably fixes the error
Resolve errors in unit test |
What're the errors - there was definitely no errors when I last checked |
"All checks have failed" (see above Github runs) |
══ Skipped tests (1) ═══════════════════════════════════════════════════════════ ══ Failed tests ════════════════════════════════════════════════════════════════
[ FAIL 1 | WARN 6 | SKIP 1 | PASS 175 ] 3 errors ✖ | 0 warnings ✔ | 4 notes ✖ |
ok interesting, I missed that cause it passed locally with devtools::test(), but failed in the CI/CD pipeline. Anyway I've made the testing abit more robust so will commit it now, which should sort it out. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #128 +/- ##
========================================
Coverage ? 56.62%
========================================
Files ? 13
Lines ? 2545
Branches ? 0
========================================
Hits ? 1441
Misses ? 1104
Partials ? 0 ☔ View full report in Codecov by Sentry. |
Great work! Looks nice |
Ubuntu check: Error in Mac and windows fails because they do not find new mia functions. They should be resolved automatically |
Fixed the error. I also changed the allowed values for centering to be mean, median and NULL (NULL is common to denote that something has been disabled) |
OK great, thanks, sounds good! |
No description provided.