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

plotLoadings only returns loadings for a single block or input dataframe #120

Closed
aljabadi opened this issue Jan 22, 2021 · 1 comment · Fixed by #180 or #212
Closed

plotLoadings only returns loadings for a single block or input dataframe #120

aljabadi opened this issue Jan 22, 2021 · 1 comment · Fixed by #180 or #212
Assignees
Labels
bug Something isn't working

Comments

@aljabadi
Copy link
Collaborator

aljabadi commented Jan 22, 2021


🐞 Describe the bug:

If plotLoadings() is used on a block.splsda object with either contrib = NULL or contrib = c("min", "max"), only the loading values for a single block would be returned. Plotting itself was error-free, just the return object did not contain values for all blocks.


🔍 reprex results from reproducible example including sessioninfo():

data(nutrimouse)
diablo <- block.splsda(X = list(gene = nutrimouse$gene, 
                                lipid = nutrimouse$lipid), 
                       Y = nutrimouse$diet)
loadings <- plotLoadings(diablo)

loadings
#>      importance
#> 1  -0.360227768
#> 2  -0.331729473
#> 3  -0.314148465
#> 4  -0.303316396
#> 5   0.299632741
#> 6  -0.296755951
#> 7   0.263466890
#> 8   0.244520537
#> 9   0.229896984
#> 10  0.226709901
#> 11 -0.204480202
#> 12  0.186359049
#> 13  0.151717007
#> 14  0.141162151
#> 15  0.110090744
#> 16  0.109898753
#> 17  0.084629329
#> 18 -0.069727400
#> 19 -0.048532395
#> 20 -0.010039842
#> 21  0.006153126

🤔 Expected behavior:

The output of plotLoadings() would contain loading values for all blocks rather than just one of them.


💡 Possible solution:

When iterating over blocks, plotLoadings() likely writes over previous blocks' loading values and then only returns the last set of loadings values

@aljabadi aljabadi changed the title plotLoadings does not return all loadings for diablo objects plotLoadings does not return loadings for all blocks for diablo objects Jan 22, 2021
@Max-Bladen Max-Bladen self-assigned this Mar 8, 2022
Max-Bladen added a commit that referenced this issue Mar 8, 2022
Max-Bladen added a commit that referenced this issue Mar 8, 2022
@Max-Bladen Max-Bladen added the bug Something isn't working label Mar 9, 2022
@Max-Bladen Max-Bladen linked a pull request Mar 9, 2022 that will close this issue
aljabadi added a commit that referenced this issue May 2, 2022
Max-Bladen added a commit that referenced this issue May 2, 2022
bug: brought the output of `plotLoadings()` on MINT objects in line with the other methods

Within `plotLoadings.mint.pls()`, adjusted the value of `block` in the `plotLoadings.mixo_pls()` call. This means that both the `X` and `Y` loading values are returned, rather than just `X`
@Max-Bladen Max-Bladen linked a pull request May 2, 2022 that will close this issue
@Max-Bladen Max-Bladen changed the title plotLoadings does not return loadings for all blocks for diablo objects plotLoadings only returns loadings for a single block or input dataframe May 3, 2022
@Max-Bladen
Copy link
Collaborator

Please refer to PR #212 as to why this issue has been reopened

@Max-Bladen Max-Bladen reopened this May 3, 2022
@Max-Bladen Max-Bladen added the wip work-in-progress label May 3, 2022
Max-Bladen added a commit that referenced this issue May 3, 2022
bug: when `plotLoadings()` is run on `mint.(s)pls` objects, the inputted `study` parameter is now checked

Prior to this commit, the `check.input.plotLoadings()` call within `plotLoadings.mint.pls()` did not pass the `study` parameter through, meaning that the checks that exist were not being utilised at all
Max-Bladen added a commit that referenced this issue May 17, 2022
test: added test case for `mint.(s)pls` in `test-plotLoadings.R` to ensure coverage of diff

also adjusted `is()` calls to `inherits()` to see if this solves `vignette.Rmd` issue - unlikely
Max-Bladen added a commit that referenced this issue Jun 8, 2022
fix: plotLoadings: is -> inherits
@Max-Bladen Max-Bladen removed the wip work-in-progress label Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants