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

Add background.predict support for mint.splsda #24

Closed
aljabadi opened this issue May 30, 2019 · 1 comment · Fixed by #226
Closed

Add background.predict support for mint.splsda #24

aljabadi opened this issue May 30, 2019 · 1 comment · Fixed by #226
Assignees
Labels
enhancement-request New feature or request

Comments

@aljabadi
Copy link
Collaborator

Hi,

trying to perform this:

data(stemcells)
res = mint.splsda(X = stemcells$gene, Y = stemcells$celltype, ncomp = 3,
                  study = stemcells$study)


background = background.predict(res, comp.predicted = 2, dist = "max.dist")

plotIndiv(res, background = background, legend = TRUE, alpha.background = 0.3 )

I get the following error:

Error in matrix(attr(Y, "scaled:center"), nrow = nrow(t.pred[[1]]), ncol = q, :
'data' must be of a vector type, was 'NULL'

I tried to debug it and found out that the mean_centering_per_study function expects "scaled:center" and "scaled"scale" attributes in res$ind.mat which in MINT case have different names and are on a per-study basis: mean:[study-index] and sigma:[study-index]. I was thinking maybe defining a pre-study max.dist and take the max of those for membership would be a good idea but I wasn't sure and the code is a bit hard to follow without comments. Would appreciate if you could add it to the mixOmics.

@mixOmicsTeam mixOmicsTeam pinned this issue Jun 4, 2019
@mixOmicsTeam mixOmicsTeam added the enhancement-request New feature or request label Jun 19, 2019
@aljabadi aljabadi added the wip work-in-progress label Aug 5, 2019
@aljabadi aljabadi unpinned this issue Aug 5, 2019
@Benfeitas
Copy link

I find the same error in 6.14.0 when using the result of plsda(...) as input if dist = 'max.dist', but not when considering centroids.dist or mahalanobis.dist.

@Max-Bladen Max-Bladen removed the wip work-in-progress label Mar 14, 2022
@Max-Bladen Max-Bladen added the wip work-in-progress label Mar 21, 2022
@Max-Bladen Max-Bladen self-assigned this Mar 21, 2022
Max-Bladen added a commit that referenced this issue Mar 28, 2022
@Max-Bladen Max-Bladen linked a pull request Mar 28, 2022 that will close this issue
@Max-Bladen Max-Bladen removed the wip work-in-progress label Mar 29, 2022
@Max-Bladen Max-Bladen linked a pull request Aug 1, 2022 that will close this issue
@Max-Bladen Max-Bladen added the ready-to-review for all PRs that are ready to be reviewed. including complex, larger commits label Aug 1, 2022
Max-Bladen added a commit that referenced this issue Dec 13, 2022
enhance: adding the functionality required in `plotIndiv.mint.pls()` in order to handle and use output from `background.predict()`. Involves adding parameter and correctly adjusting limits of plot to accommodate polygons

enhance: moved the definitions of global attributes `scaled:center` and `scaled:scale` out of `else` statement prevent it's usage

fix: adjust minor error in previous commit. extremes of background polygons is now correctly calculated

enhance: copied code segment used by this function and added it to `style == "ggplot2-MINT"`

docs: SemVer updated and `plotIndiv()` documentation updated

test: add test for `plotIndiv` on MINT object with background. maintains coverage
@Max-Bladen Max-Bladen removed the ready-to-review for all PRs that are ready to be reviewed. including complex, larger commits label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement-request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants