Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot eigenvalues #159

Closed
TuomasBorman opened this issue Oct 20, 2024 · 3 comments · Fixed by #160
Closed

Plot eigenvalues #159

TuomasBorman opened this issue Oct 20, 2024 · 3 comments · Fixed by #160
Assignees

Comments

@TuomasBorman
Copy link
Contributor

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.

The function name could be plotScree or plotEigenvalues

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.

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.

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
Copy link
Contributor

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

@TuomasBorman
Copy link
Contributor Author

That comes from scater

@Daenarys8
Copy link
Contributor

That comes from scater

thanks

@TuomasBorman TuomasBorman linked a pull request Nov 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants