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 feature loadings function #135

Merged
merged 69 commits into from
Aug 13, 2024

Conversation

ElySeraidarian
Copy link
Contributor

@ElySeraidarian ElySeraidarian commented Jul 9, 2024

According to #92, we need a way to plot feature loadings after performing a reduction method by several ways. Here is a first version with PCA that plots feature loadings in 4 different ways : Tree, Barplot, Screeplot & Heatmap. This will be available for LDA & NMF as soon as it is possible to retrieve loadings matrix from reducedDim slot. There are parameters that can be added so that we can talk about it (for example the number of features plotted). The parameter method is probably doomed to disappear as we will be able to recognize which method has been used in the reducedDim slot. There are examples for NMF & LDA at the end for now without using the function. This will need examples in OMA and strong documentation in order to tell people how to use this function (agglomerate tree if plotting the tree, only plotting few features, ...). It is currently possible to give either loadings matrix or TSE object to plot.

I will add tests & generate documentation also later.

@ElySeraidarian
Copy link
Contributor Author

ElySeraidarian commented Aug 2, 2024

Changes have been made, heatmap has been changed and parameter add.tree instead of tree layout

seraidarian and others added 2 commits August 2, 2024 14:50
R/plotLoadings.R Outdated Show resolved Hide resolved
R/plotLoadings.R Outdated Show resolved Hide resolved
R/plotLoadings.R Outdated Show resolved Hide resolved
DESCRIPTION Outdated Show resolved Hide resolved
@TuomasBorman
Copy link
Contributor

I simplified the code a lot. Check that it still works as expected. Also run BiocCheck::BiocCheck() and fix issues related to this added R file (especially, do not exceed 80 characters in line width). Also use inheritParam tag in the documentation.

@TuomasBorman
Copy link
Contributor

Thing to discuss: should rank be row.var? --> variable defining a column from rowData. That is what it is doing currently

@ElySeraidarian
Copy link
Contributor Author

Thing to discuss: should rank be row.var? --> variable defining a column from rowData. That is what it is doing currently

Yes I believe this would make more sense

@antagomir
Copy link
Member

Seems good.

@ElySeraidarian
Copy link
Contributor Author

But we could also still create a parameter rank that agglomerates tree as in the other functions

@TuomasBorman
Copy link
Contributor

But we could also still create a parameter rank that agglomerates tree as in the other functions

If we agglomerate the data, we lose the match between loadings and rows. Loadings are for features of un-agglomerated data --> that is my first impression, check if that is correct

@ElySeraidarian
Copy link
Contributor Author

But we could also still create a parameter rank that agglomerates tree as in the other functions

If we agglomerate the data, we lose the match between loadings and rows. Loadings are for features of un-agglomerated data --> that is my first impression, check if that is correct

Yes that's right, agglomeration has to be done before performing the reduction method

@TuomasBorman
Copy link
Contributor

  1. I removed authors. See the issue: Remove authors from functions mia#628
  2. You should perform first agglomeration and then transform the data (fixed)
  3. I added a check that the feature names match in tree heatmap

@TuomasBorman
Copy link
Contributor

Looks very nice. Are you interested in updating OMA: https://microbiome.github.io/OMA/docs/devel/pages/beta_diversity.html#sec-dbrda-workflow

If I remember correctly, there were some error?

@TuomasBorman TuomasBorman merged commit 1217307 into microbiome:devel Aug 13, 2024
2 of 3 checks passed
@ElySeraidarian
Copy link
Contributor Author

Looks very nice. Are you interested in updating OMA: https://microbiome.github.io/OMA/docs/devel/pages/beta_diversity.html#sec-dbrda-workflow

If I remember correctly, there were some error?

I will update using this function, I found same results when plotting. Also this example shows how to retrieve the loadings (for now we can plot only by getting matrix and then giving the matrix to plot).

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 this pull request may close these issues.

3 participants