Hi
Thank you for your useful Software.
I was wondering if someone can show me some example R code that can do the following:
"The mixOmics Partial Least Square (PLS) algorithm was used to unravel the multivariate relationship between the gene fold changes and the serological responses (areas under the curve). The genes were then ranked by their contribution to the PLS first component "
Taken from here:https://www.nature.com/articles/s41541-019-0151-3#MOESM2
Thank you very much for your consideration and help
Hi @question , here is an example using a non-sparse PLS model to analyse the nutrimouse data:
library(mixOmics)
data(nutrimouse)
X <- nutrimouse$gene
Y <- nutrimouse$lipid
MyResult.pls <- pls(X,Y)
plotLoadings(MyResult.pls, comp = 1)
The output should look like this:
For details and explanations i can recommend you to look at the vignette: https://www.bioconductor.org/packages/release/bioc/vignettes/mixOmics/inst/doc/vignette.html#pls
Kind regards
Christopher
Thanks @christoa, I was about to suggest similar output
@question you can extract the top contributing PLS variables using the selectVar()
function. There is also the vip()
function for a PLS-regression only.
Kim-Anh
Hi everyone!
I would like to model a causal relationship between a phenotypic trait (Grain yield) and SNP data and evaluate how informative my SNP data are to predict this trait. I tried to do so:
Pheno<-read.csv(“DataPheno.csv”, header = T, sep = “;”, dec = “,”)
Y<-mydata$YLD
X<-read.csv(“DataMarkers.csv”, header = F, sep = “;”)
library(mixOmics)
model<-pls(Y, X , ncomp = 3, mode = “regression”)
But I recorded this error:
Error in Check.entry.pls(X, Y, ncomp, keepX, keepY, mode = mode, scale = scale, :
‘X’ must be a numeric matrix.
However, when I check in this way, it shows me that my matrix is numeric
is.numeric(X)
[1] TRUE
Please someone can let me know what’s wrong?
What should I do?
Thank you for your help
@GMB
I would specify clearly X = X and Y= Y in the call. Check that you X does not have any weird characters. Also try a X = as.matrix(X) (although I dont think this is the problem, I think it is your input data that somehow are not showing what you want, perhaps a header…)
Kim-Anh