Open mauromiguelm opened 1 year ago
I tested age and height, three continuous variables as in the table below
Upload module:
sample information dataview:
Results:
Continuous variables get kicked out from the phenotype selection.. is this correct @ivokwee, should we somehow force dichotomize it? Based on the feedback I will update documentation and do the changes.
Clustering
Correlation analysis
In the pgx object there used to be, or still is, pgx$samples and pgx$Y. The latter should be a cleaner and discretized version of the former. I try to keep pgx$samples as original as possible. But I failed to use this consistently. The nicest thing would be in the UI to check and ask to discretize continuous variables: 2-3-4 groups. Ideally we should be able to handle statistics for CV. But now you have to discretize or use them solely for visualization. Would be nice also to be able to plot CV against other vars (some people asked that).
Yes. There is code somewhere that tries to intelligently detect CV or Discrete var. Not always robust. But such a code is very important for creating auto contrasts.
Follow up:
The phenotype association plot uses pgx$samples, which still has the continuous values. annot <- pgx$samples
pgx$Y on the other hand, is lacking the discretized values.
It seems pgx$Y, for some reason (bug?) is not discretizing continuous variables anymore.
Two solution that comes to mind here:
Do it at the pgx check level, where we discretive ourselves and tell the user we will discretize these values. This is very easy to do in crosscheckInput function. We could even create new columns age > age_discrete in pgx$samples, but that would not keep pgx$samples clean anymore.
Find the bug on why pgx$Y is not being discretized, or add that functionality. But since pg$Y is created inside pgx.compute (or initialize), its way more difficult to inform the user continues variables will be discretized, compared to doing it in the check functions, where we already have all systems in place to tell user and make changes to inputs.
I am not sure which of the options I should go for, but it seems important that if age, height or any random_continuous variables are removed from the phenotypes, we should somehow tell the user or fix it,
Cheers, M
@ivokwee @ncullen93 this is what we discussed today, how should we proceed?
Right, as Ivo said I think the best thing is to keep pgx$samples completely untouched after upload, and pgx$Y should be what is changed. We will have to go through all the code to ensure that though.
It seems pgx$Y, for some reason (bug?) is not discretizing continuous variables anymore.
we first need to understand why pgx$Y is not showing continuous values, any idea how much work updating pgx$samples to pgx$Y will require?
document if "continuous" variable names like
age
andheight
are accepted in OPG