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.
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
orplotEigenvalues
2.
We could have methods for
SingleCellExperiment
, andvector
.SingleCellExperiment method gets the value from
reducedDim(x, dimred)
, from the correct attribute like functionsplotRDA()
andplotLoadings()
. It creates a vector from the data with component names innames()
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.