mixMC framework

Create issue
Issue #54 resolved
Kim-Anh Le Cao repo owner created an issue

As discussed, functions to add or improve (pull from DEVEL)

Framework is:

filter -> TSS -> CLR/ILR -> multilevel -> PCA or sPLSDA

  • mixMC.filter

  • mixMC.TSS

  • pca(logratio = c('CLR', 'ILR')

  • splsda(logratio = c('CLR')

  • multilevel(logratio = c('CLR', 'ILR', method = c('splsda', 'spls', 'pca'))

  • cladogram.input()

  • add most diverse data as data.raw, indiv and taxonomy (only those 3!)

When you update those files, please comment on this issue point by point.

Note: make sure splsda can only have CLR transformation!

Comments (13)

  1. Kim-Anh Le Cao reporter

    NOTE: disregard my comment about V = NULL. We still need it to be called from multilevel so OK. You need to merge ilr.transfo and the V calculation in a single function. It will avoid copy paste in PCA and PCA multilevel. See next ocmment.

    Hi Francois, Thanks for that. For any choices, e.g. Logratio in your pca function, I would prefer something like:

    logratio = c('none', 'ILR')

    In the argument call of the function, instead of:

    pca <-

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/pca.RT25

    +function(X,

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/pca.RT26

    • ncomp = 2,

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/pca.RT27

    • center = TRUE,

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/pca.RT28

    • scale = FALSE,

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/pca.RT29

    • max.iter = 500,

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/pca.RT30

    • tol = 1e-09,

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/pca.RT31

    • logratio = 'none',

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/pca.RT32

    • V=NULL)

    It just makes things more readable when we write the help file.

    Also, in PCA, the V should not be an input but should be calculated directly inside the pca function when logratio = 'ILR', as you then did.

    Make sure once you have included V inside that you test thoroughly to obtain the same results as before!

    Regards,

    Kim-Anh

    Too brief? Apologies, I need to restrain my typing due to a computer elbow injury.

    --

    Dr. Kim-Anh Lê Cao

    NHMRC Career Development Fellow

    ResTeach Affiliate (School of Chemistry and Molecular Biosciences)

    The University of Queensland Diamantina Institute

    Translational Research Institute

    Level 5, 37 Kent Street | Woolloongabba QLD 4102

    T: +61 (0)7 3443 7069| F: +61 (0)7 3443 6966

    http://www.tri.edu.au/staff/kim-anh-le-cao

    mixOmics: http://mixomics.org/

  2. Kim-Anh Le Cao reporter

    For multilevel: you cannot do a logratio ILR with sPLSDA, I propose you reset it to CLR instead (not 'none')

    • if(logratio == 'ILR')

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT182

    • {

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT183

    • warning("reset 'ILR' to 'CLR' for sPLSDA.",

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT184

    • call. = FALSE)

    #KA: and so, where is your reset?

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT185

    • }

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT186

    • else if (logratio == 'CLR')

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT187

    • {

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT188

    • X.clr=clr.transfo(X)

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT189

    • rownames(X.clr) = rownames(X)

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT190

    • X=X.clr

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT191

    I think you can include the clr.backtransfo function directly inside the ilr.transfo. That will avoid you to repeat in all functions (PCA and multilevel PCA).

    And now I understand why the V is necessary inside the PCA function :) OK!

    V = clr.backtransfo(X)

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT241

    • dim(V)

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT242

    • 2 - PCA on ILR data

    https://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#add-commenthttps://bitbucket.org/klecao/package-mixomics/pull-requests/124/mixmc/diff#LmixOmics/R/multilevel.RT243

    • res = pca(X = X.ilr, ncomp = ncomp, logratio = 'ILR', V = V)

    KA: note: your loratio is hardcoded here.

    Regards,

    Kim-Anh

    Too brief? Apologies, I need to restrain my typing due to a computer elbow injury.

    --

    Dr. Kim-Anh Lê Cao

    NHMRC Career Development Fellow

    ResTeach Affiliate (School of Chemistry and Molecular Biosciences)

    The University of Queensland Diamantina Institute

    Translational Research Institute

    Level 5, 37 Kent Street | Woolloongabba QLD 4102

    T: +61 (0)7 3443 7069| F: +61 (0)7 3443 6966

    http://www.tri.edu.au/staff/kim-anh-le-cao

    mixOmics: http://mixomics.org/

  3. fbartolo

    Hi Kim-Anh,

    To splsda reset, in fact, it's a 'none' reset also I don't need to add other thing, just a warning. I fixed pca.

  4. Kim-Anh Le Cao reporter

    I'd like the reset to be set to CLR instead of 'none'. It fits better with the mixMC philosophy (compositional data) Thanks

  5. Kim-Anh Le Cao reporter

    Can you call it normalisation.TSS? It might sound trivial but it is a matter of alphabetical order and how a user can go through the names of a thousands of functions in mixOmics :) Thanks!

  6. Log in to comment