Skip to content

Latest commit

 

History

133 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LMWiRe quickstart

R-CMD-check

Disclaimer /!\

This package has been renamed as limpca (manonmartin.github.io/limpca/). LMWiRe is no further maintained nor improved.

Installation

remotes::install_github("ManonMartin/LMWiRe", dependencies = TRUE)
library("LMWiRe")

Note that if you would like to build the vignettes, you have to install BiocStyle and rmarkdown packages before installing LMWiRe with the following command: remotes::install_github("ManonMartin/LMWiRe", dependencies = TRUE, build_vignettes = TRUE).

For any enquiry, you can send an email to the package authors: bernadette.govaerts@uclouvain.be ; michel.thiel@uclouvain.be or manon.martin@uclouvain.be

Short application on the UCH dataset

Data object

str(UCH)
#> List of 3
#>  $ design  :'data.frame':    34 obs. of  5 variables:
#>   ..$ Hippurate: Factor w/ 3 levels "0","1","2": 1 1 1 1 1 1 2 2 2 2 ...
#>   ..$ Citrate  : Factor w/ 3 levels "0","2","4": 1 1 2 2 3 3 1 1 2 2 ...
#>   ..$ Dilution : Factor w/ 1 level "diluted": 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ Day      : Factor w/ 2 levels "2","3": 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ Time     : Factor w/ 2 levels "1","2": 1 2 1 2 1 2 1 2 1 2 ...
#>  $ outcomes: num [1:34, 1:600] 0.0312 0.0581 0.027 0.0341 0.0406 ...
#>   ..- attr(*, "dimnames")=List of 2
#>   .. ..$   : chr [1:34] "M2C00D2R1" "M2C00D2R2" "M2C02D2R1" "M2C02D2R2" ...
#>   .. ..$ X1: chr [1:600] "9.9917004" "9.9753204" "9.9590624" "9.9427436" ...
#>  $ formula : chr "outcomes ~ Hippurate + Citrate + Time + Hippurate:Citrate + Time:Hippurate + Time:Citrate + Hippurate:Citrate:Time"

Data visualisation

# design
plotDesign(design = UCH$design, x = "Hippurate", 
           y = "Citrate", rows = "Time",
           title = "Design of the UCH dataset")

# row 3 of outcomes
plotLine(Y = UCH$outcomes,
         title = "H-NMR spectrum",
         rows = c(3),
         xlab = "ppm",
         ylab = "Intensity")

PCA

ResPCA = pcaBySvd(UCH$outcomes)
pcaScreePlot(ResPCA, nPC = 6)

pcaScorePlot(resPcaBySvd = ResPCA, axes = c(1,2), 
             title = "PCA scores plot: PC1 and PC2", 
             design = UCH$design,
             color = "Hippurate", shape = "Citrate",
             points_labs_rn = FALSE)

Model estimation and effect matrix decomposition

# Model matrix generation
resMM = lmwModelMatrix(UCH)

# Model estimation and effect matrices decomposition
resEM = lmwEffectMatrices(resMM)

Effect matrix test of significance and importance measure

# Effects importance
resEM$varPercentagesPlot

# Bootstrap tests
resBT = lmwBootstrapTests(resLmwEffectMatrices = resEM, nboot=100)
resBT$resultsTable
#>                        % of variance (T III) Bootstrap p-values
#> Hippurate                              39.31             < 0.01
#> Citrate                                29.91             < 0.01
#> Time                                   16.24             < 0.01
#> Hippurate:Citrate                       1.54               0.12
#> Hippurate:Time                          6.23             < 0.01
#> Citrate:Time                            0.54                0.5
#> Hippurate:Citrate:Time                  1.68               0.11
#> Residuals                               4.30                  -

ASCA-E decomposition

# ASCA-E decomposition
resASCAE = lmwPcaEffects(resLmwEffectMatrices = resEM, method="ASCA-E")

# Scores Plot for the hippurate
lmwScorePlot(resASCAE, effectNames = "Hippurate", 
             color = "Hippurate", shape = "Hippurate")

# Loadings Plot for the hippurate
lmwLoading1dPlot(resASCAE, effectNames = c("Hippurate"), 
                              axes = 1, xlab = "ppm")
#> $Hippurate

# Scores ScatterPlot matrix
lmwScoreScatterPlotM(resASCAE,PCdim=c(1,1,1,1,1,1,1,2),
                     modelAbbrev = TRUE,
                     varname.colorup = "Citrate",
                     varname.colordown  = "Time",
                     varname.pchup="Hippurate",
                     varname.pchdown="Time",
                     title = "ASCA scores scatterplot matrix")

About

Package LMWire : Linear models for Wide responses

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages