Repository navigation
add getSurvival - #112
add getSurvival#112
Conversation
Signed-off-by: Daena Rys <rysdaena8@gmail.com>
|
This wrapper currently defaults to using pairwise log-ratio (PLR) transformations via plr was selected by the authors over clr, ilr, or alr for reasons related to interpretability, sparsity, and model perfomance in high-dimensional microbiome survival analysis. While this default appears justified and performs well empirically, it may not be optimal in all cases. If plr proves sufficient across expected use cases, we can add the unit tests around this assumption. If user needs or new evidence suggest flexibility is needed, we should refactor to allow other transformation via a parameter (e.g., transform.method = "plr", "clr", "ilr", etc.). or Currently the method returns a list of objects including ggplots and dfs/matrices. We can consider Open to discussion on whether this needs to be prioritized now or flagged for future maintenance.. |
TuomasBorman
left a comment
There was a problem hiding this comment.
Thanks for this clear PR!
One thing to discuss is how much functionality we want to utilize from coda4microbiome package. If there are plans for broader interlinking, this PR might be fine. However, under the hood, coda_coxnet() is utilizing survival::coxph() and glmnet::cv.glmnet() and survminer for plotting.
The implementation in coda_coxnet() is not complex but includes some overhead that -- in my opinion -- does not necessarily fit well to our current design choices (transformation, printing, plotting).
Instead, this functionality for cox model could be implemented directly in miaTime package. We could take inspiration from the coda4microbiome package, but it seems that there is licence mismatch so this should be taken into account.
|
Thanks! Indeed, I would not wrap coda4microbiome. We may like to test and run standard survival models (Cox) also with other transformation. So let's keep separate:
This can take inspiration from coda4microbiome and cite it but Cox & GLM are more general and previously published methods. Moreover, the coda4microbiome paper did not include many comparisons to alternative transformations & methods. Our implementation should be modular and support different combinations of choices (e.g. transformation -> testing -> presentation). The miaTime already includes data from the paper as example data, that could be used to verify the workflow (should yield the same result). |
0xMuluh
left a comment
There was a problem hiding this comment.
Thoughts. @antagomir @TuomasBorman
TuomasBorman
left a comment
There was a problem hiding this comment.
Thanks! Can you also add unit tests?
unit tests added after #107 |
|
In manpage description clearly cite the publication where the data is from (note that there is a special way to add citations in roxygen). Now you only refer to R package. But there is also formal publication to cite. Cite all references in the manpage text so that it is clear why they are added on the reference list. Running the manpage examples gives error
Either the function name should be getCox or something explicit, or if it is getSurvival then there should be a method argument that specific what survival method one wants to use. |
|
These are time-to-event models. How about renaming status.col into event.col? |
|
getSurvival has A list with model summaries: -> Harmonize to use "_" as the separator for all (do not mix) -> cindex.apparent could be C.apparent, or just C ? -> For clarity I would rename cv.cindex.mean to C.mean.cv and same for the SD ting -> should selected_features be just nonzero_features if these are the same thing -> coefficients is usually just coef in many R methods -> harmonize? |
The data has not been used. Will use this data instead: b752170 |
Thanks, there was a typo |
Signed-off-by: Daena Rys <rysdaena8@gmail.com>
# Conflicts: # NAMESPACE # NEWS
coxph(y ~ ., data) used every column of a data frame that included time and status, in the standard model and in the covariate model of the penalized fit. Keep the original feature names so that coefficients match rownames. Import predict from stats.
Coefficients are added to rowData and risk scores to colData, as suggested in review; the full results stay in metadata. Add a Details section describing the model and the coefficient rescaling.
Use the same seed for both fits, and check that the rescaled coefficients sum to 2 in absolute value instead of comparing them to the threshold.
TuomasBorman
left a comment
There was a problem hiding this comment.
Thank you! Sorry for very long delay...
Future extension could be formula argument. Not sure how often that would be needed, so I think the current is good. But the idea would be that the user has more control in modeling the penalized version:
formula = relabundance ~ age * sex
antagomir
left a comment
There was a problem hiding this comment.
I would request at least these updates.
Since this is a variant of linear model it might fit better to LimROTS package as a standard alternative that can be used to benchmark the optimized survival methods in LimROTS? This way we could also be clear what is the recommended option after validation - @TuomasBorman ?
| #' tse, assay.type = "relabundance", | ||
| #' time.col = "event_time", event.col = "event" | ||
| #' ) | ||
| #' |
There was a problem hiding this comment.
Could we add example on how the results are summarized (e.g. as table) and visualized?
| #' (e.g. with \code{mia::transformAssay()}). | ||
| #' | ||
| #' @details | ||
| #' \code{getSurvival()} fits a Cox proportional hazards model with the |
There was a problem hiding this comment.
If this only provides Cox model variants then it could be more clear to mark it as getCox (or getCoxSurvival but maybe the shorter is better). If we add more options later, then we can switch to a more generic name.
| #' \item \code{nfolds}: \code{Integer scalar}. Number of cross-validation | ||
| #' folds for \code{cv.glmnet}. (Default: \code{10}) | ||
| #' | ||
| #' \item \code{nvar}: \code{Integer scalar}. Optional. Maximum number of |
There was a problem hiding this comment.
if this is max number then max.var, max.features, or something could work better. Did you compare with other functions with similar parameters -> harmonize the argument name if possible.
Thanks, done in #166: |
|
@0xMuluh Can you close the discussion issues above if they are resolved - will make it easier to monitor the progress on this one Open a new issue on "formula argument" point mentioned by Tuomas above. |
ping #93