microbiome / miaViz

Microbiome Analysis Plotting and Visualization
https://microbiome.github.io/miaViz
Artistic License 2.0
10 stars 12 forks source link

Plot eigenvalues #159

Closed TuomasBorman closed 1 week ago

TuomasBorman commented 1 month ago

Single-cell toolbox and mia do not currently have function for visualizing eigenvalues. Usually, that it done with screeplot that shows how the eigenvalues decreases.

1.

The function name could be plotScree or plotEigenvalues

2.

We could have methods for SingleCellExperiment, and vector.

SingleCellExperiment method gets the value from reducedDim(x, dimred), from the correct attribute like functions plotRDA() and plotLoadings(). It creates a vector from the data with component names in names() and call the vector function.

Note that not all functions store the eigenvalues to same place / under same attribute name.

As usually eigenvalues are returned as a vector, we could have a method for vector also. That function could just create a data.frame from the vector. The data.frame could have the eigenvalues in one column and the names of vector in another.

3.

Eigenvalues are commonly visualized with combination of barplot, point plot, line plot and labels. We could have them all but user could control them with show.*. These could be hidden parameters to make the methods less complex.

4.

Moreover, we could have also a cumulative explained variance plot that shows how much variance is explained by the first i component. That could also be a hidden option. Maybe cumulative = FALSE. In theory, that just needs one extra step that calculates the cumulative proportion.

image

Daenarys8 commented 1 month ago

did we deprecate runPCA? I can't find the function.

TuomasBorman commented 1 month ago

That comes from scater

Daenarys8 commented 1 month ago

That comes from scater

thanks