ComputationalProteomics / OmicLoupe

Understanding expression across comparisons and datasets through interactive visualization
http://quantitativeproteomics.org/omicloupe
MIT License
2 stars 3 forks source link

Numerical variables cannot be plotted in PCA #15

Open Jakob37 opened 2 hours ago

Jakob37 commented 2 hours ago

Seems to be coming from this part of the code, which in my data converted:

> raw_df[["yield_vol"]]
 [1] 0.05 0.09 0.09 0.06 0.09 0.08 0.22 0.13 0.20 0.14 0.08 0.12 0.12 0.19 0.11 0.21 0.12 0.20 0.14 0.11 0.05 0.09 0.10 0.18 0.12 0.16 0.08 0.06 0.05
[30] 0.18 0.26 0.17 0.11 0.15 0.09 0.02 0.15 0.05 0.11 0.19 0.09 0.05 0.16

to

> raw_df[["yield_vol"]]
 [1] "X0.05" "X0.09" "X0.09" "X0.06" "X0.09" "X0.08" "X0.22" "X0.13" "X0.2"  "X0.14" "X0.08" "X0.12" "X0.12" "X0.19" "X0.11" "X0.21" "X0.12" "X0.2" 
[19] "X0.14" "X0.11" "X0.05" "X0.09" "X0.1"  "X0.18" "X0.12" "X0.16" "X0.08" "X0.06" "X0.05" "X0.18" "X0.26" "X0.17" "X0.11" "X0.15" "X0.09" "X0.02"
[37] "X0.15" "X0.05" "X0.11" "X0.19" "X0.09" "X0.05" "X0.16"

https://github.com/ComputationalProteomics/OmicLoupe/blob/0f41a0850c6d7f37cbdf9aa3b62362ca36c320b2/R/reactive_values.R#L21

After removing that line I get the desired PCA chart (before it will be a categorical coloring, one value per category):

reason

Jakob37 commented 2 hours ago

The consequece is that all variables (including numbers) in the design matrix are converted to valid names. I suspect this has been added to solve some other issue, do you know @manszamore ? I would rather revert it and solve that other issue some other way.

I can make a PR for fixing this.